<!DOCTYPE html>
<html lang="en-US">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="language" content="en" />
        <link href="./assets/ffd55088/css/bootstrap.css" rel="stylesheet">
<link href="./assets/5cf9384a/solarized_light.css" rel="stylesheet">
<link href="./assets/6c54116e/style.css" rel="stylesheet">
<script src="./assets/a44cef0f/jquery.js"></script>
<script src="./assets/ffd55088/js/bootstrap.js"></script>
<script src="./assets/8ac4e28a/jssearch.js"></script>    <title>Model, yii\base\Model - Yii Framework 2.0 API Documentation</title>
</head>
<body>

<div class="wrap">
    <nav id="w2241" class="navbar-inverse navbar-fixed-top navbar" role="navigation"><div class="navbar-header"><button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#w2241-collapse"><span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span></button><a class="navbar-brand" href="./index.html">Yii Framework 2.0 API Documentation</a></div><div id="w2241-collapse" class="collapse navbar-collapse"><ul id="w2242" class="navbar-nav nav"><li><a href="./index.html">Class reference</a></li>
<li class="dropdown"><a class="dropdown-toggle" href="#" data-toggle="dropdown">Extensions <b class="caret"></b></a><ul id="w2243" class="dropdown-menu"><li><a href="./ext-apidoc-index.html" tabindex="-1">apidoc</a></li>
<li><a href="./ext-authclient-index.html" tabindex="-1">authclient</a></li>
<li><a href="./ext-bootstrap-index.html" tabindex="-1">bootstrap</a></li>
<li><a href="./ext-codeception-index.html" tabindex="-1">codeception</a></li>
<li><a href="./ext-debug-index.html" tabindex="-1">debug</a></li>
<li><a href="./ext-elasticsearch-index.html" tabindex="-1">elasticsearch</a></li>
<li><a href="./ext-faker-index.html" tabindex="-1">faker</a></li>
<li><a href="./ext-gii-index.html" tabindex="-1">gii</a></li>
<li><a href="./ext-imagine-index.html" tabindex="-1">imagine</a></li>
<li><a href="./ext-jui-index.html" tabindex="-1">jui</a></li>
<li><a href="./ext-mongodb-index.html" tabindex="-1">mongodb</a></li>
<li><a href="./ext-redis-index.html" tabindex="-1">redis</a></li>
<li><a href="./ext-smarty-index.html" tabindex="-1">smarty</a></li>
<li><a href="./ext-sphinx-index.html" tabindex="-1">sphinx</a></li>
<li><a href="./ext-swiftmailer-index.html" tabindex="-1">swiftmailer</a></li>
<li><a href="./ext-twig-index.html" tabindex="-1">twig</a></li></ul></li>
<li><a href="./guide-README.html">Guide</a></li></ul><div class="navbar-form navbar-left" role="search">
  <div class="form-group">
    <input id="searchbox" type="text" class="form-control" placeholder="Search">
  </div>
</div>
</div></nav>
    <div id="search-resultbox" style="display: none;" class="modal-content">
        <ul id="search-results">
        </ul>
    </div>

    
<div class="row">
    <div class="col-md-3">
                <div id="navigation" class="list-group"><a class="list-group-item" href="#navigation-2210" data-toggle="collapse" data-parent="#navigation">Not namespaced classes <b class="caret"></b></a><div id="navigation-2210" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii.html">Yii</a></div>
<a class="list-group-item" href="#navigation-2211" data-toggle="collapse" data-parent="#navigation">yii <b class="caret"></b></a><div id="navigation-2211" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-baseyii.html">BaseYii</a></div>
<a class="list-group-item active" href="#navigation-2212" data-toggle="collapse" data-parent="#navigation">yii\base <b class="caret"></b></a><div id="navigation-2212" class="submenu panel-collapse collapse in"><a class="list-group-item" href="./yii-base-action.html">Action</a>
<a class="list-group-item" href="./yii-base-actionevent.html">ActionEvent</a>
<a class="list-group-item" href="./yii-base-actionfilter.html">ActionFilter</a>
<a class="list-group-item" href="./yii-base-application.html">Application</a>
<a class="list-group-item" href="./yii-base-arrayaccesstrait.html">ArrayAccessTrait</a>
<a class="list-group-item" href="./yii-base-arrayable.html">Arrayable</a>
<a class="list-group-item" href="./yii-base-arrayabletrait.html">ArrayableTrait</a>
<a class="list-group-item" href="./yii-base-behavior.html">Behavior</a>
<a class="list-group-item" href="./yii-base-bootstrapinterface.html">BootstrapInterface</a>
<a class="list-group-item" href="./yii-base-component.html">Component</a>
<a class="list-group-item" href="./yii-base-configurable.html">Configurable</a>
<a class="list-group-item" href="./yii-base-controller.html">Controller</a>
<a class="list-group-item" href="./yii-base-dynamicmodel.html">DynamicModel</a>
<a class="list-group-item" href="./yii-base-errorexception.html">ErrorException</a>
<a class="list-group-item" href="./yii-base-errorhandler.html">ErrorHandler</a>
<a class="list-group-item" href="./yii-base-event.html">Event</a>
<a class="list-group-item" href="./yii-base-exception.html">Exception</a>
<a class="list-group-item" href="./yii-base-exitexception.html">ExitException</a>
<a class="list-group-item" href="./yii-base-inlineaction.html">InlineAction</a>
<a class="list-group-item" href="./yii-base-invalidcallexception.html">InvalidCallException</a>
<a class="list-group-item" href="./yii-base-invalidconfigexception.html">InvalidConfigException</a>
<a class="list-group-item" href="./yii-base-invalidparamexception.html">InvalidParamException</a>
<a class="list-group-item" href="./yii-base-invalidrouteexception.html">InvalidRouteException</a>
<a class="list-group-item" href="./yii-base-invalidvalueexception.html">InvalidValueException</a>
<a class="list-group-item active" href="./yii-base-model.html">Model</a>
<a class="list-group-item" href="./yii-base-modelevent.html">ModelEvent</a>
<a class="list-group-item" href="./yii-base-module.html">Module</a>
<a class="list-group-item" href="./yii-base-notsupportedexception.html">NotSupportedException</a>
<a class="list-group-item" href="./yii-base-object.html">Object</a>
<a class="list-group-item" href="./yii-base-request.html">Request</a>
<a class="list-group-item" href="./yii-base-response.html">Response</a>
<a class="list-group-item" href="./yii-base-security.html">Security</a>
<a class="list-group-item" href="./yii-base-theme.html">Theme</a>
<a class="list-group-item" href="./yii-base-unknownclassexception.html">UnknownClassException</a>
<a class="list-group-item" href="./yii-base-unknownmethodexception.html">UnknownMethodException</a>
<a class="list-group-item" href="./yii-base-unknownpropertyexception.html">UnknownPropertyException</a>
<a class="list-group-item" href="./yii-base-userexception.html">UserException</a>
<a class="list-group-item" href="./yii-base-view.html">View</a>
<a class="list-group-item" href="./yii-base-viewcontextinterface.html">ViewContextInterface</a>
<a class="list-group-item" href="./yii-base-viewevent.html">ViewEvent</a>
<a class="list-group-item" href="./yii-base-viewrenderer.html">ViewRenderer</a>
<a class="list-group-item" href="./yii-base-widget.html">Widget</a></div>
<a class="list-group-item" href="#navigation-2213" data-toggle="collapse" data-parent="#navigation">yii\behaviors <b class="caret"></b></a><div id="navigation-2213" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-behaviors-attributebehavior.html">AttributeBehavior</a>
<a class="list-group-item" href="./yii-behaviors-blameablebehavior.html">BlameableBehavior</a>
<a class="list-group-item" href="./yii-behaviors-sluggablebehavior.html">SluggableBehavior</a>
<a class="list-group-item" href="./yii-behaviors-timestampbehavior.html">TimestampBehavior</a></div>
<a class="list-group-item" href="#navigation-2214" data-toggle="collapse" data-parent="#navigation">yii\caching <b class="caret"></b></a><div id="navigation-2214" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-caching-apccache.html">ApcCache</a>
<a class="list-group-item" href="./yii-caching-arraycache.html">ArrayCache</a>
<a class="list-group-item" href="./yii-caching-cache.html">Cache</a>
<a class="list-group-item" href="./yii-caching-chaineddependency.html">ChainedDependency</a>
<a class="list-group-item" href="./yii-caching-dbcache.html">DbCache</a>
<a class="list-group-item" href="./yii-caching-dbdependency.html">DbDependency</a>
<a class="list-group-item" href="./yii-caching-dependency.html">Dependency</a>
<a class="list-group-item" href="./yii-caching-dummycache.html">DummyCache</a>
<a class="list-group-item" href="./yii-caching-expressiondependency.html">ExpressionDependency</a>
<a class="list-group-item" href="./yii-caching-filecache.html">FileCache</a>
<a class="list-group-item" href="./yii-caching-filedependency.html">FileDependency</a>
<a class="list-group-item" href="./yii-caching-memcache.html">MemCache</a>
<a class="list-group-item" href="./yii-caching-memcacheserver.html">MemCacheServer</a>
<a class="list-group-item" href="./yii-caching-tagdependency.html">TagDependency</a>
<a class="list-group-item" href="./yii-caching-wincache.html">WinCache</a>
<a class="list-group-item" href="./yii-caching-xcache.html">XCache</a>
<a class="list-group-item" href="./yii-caching-zenddatacache.html">ZendDataCache</a></div>
<a class="list-group-item" href="#navigation-2215" data-toggle="collapse" data-parent="#navigation">yii\captcha <b class="caret"></b></a><div id="navigation-2215" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-captcha-captcha.html">Captcha</a>
<a class="list-group-item" href="./yii-captcha-captchaaction.html">CaptchaAction</a>
<a class="list-group-item" href="./yii-captcha-captchaasset.html">CaptchaAsset</a>
<a class="list-group-item" href="./yii-captcha-captchavalidator.html">CaptchaValidator</a></div>
<a class="list-group-item" href="#navigation-2216" data-toggle="collapse" data-parent="#navigation">yii\console <b class="caret"></b></a><div id="navigation-2216" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-console-application.html">Application</a>
<a class="list-group-item" href="./yii-console-controller.html">Controller</a>
<a class="list-group-item" href="./yii-console-errorhandler.html">ErrorHandler</a>
<a class="list-group-item" href="./yii-console-exception.html">Exception</a>
<a class="list-group-item" href="./yii-console-markdown.html">Markdown</a>
<a class="list-group-item" href="./yii-console-request.html">Request</a>
<a class="list-group-item" href="./yii-console-response.html">Response</a></div>
<a class="list-group-item" href="#navigation-2217" data-toggle="collapse" data-parent="#navigation">yii\console\controllers <b class="caret"></b></a><div id="navigation-2217" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-console-controllers-assetcontroller.html">AssetController</a>
<a class="list-group-item" href="./yii-console-controllers-basemigratecontroller.html">BaseMigrateController</a>
<a class="list-group-item" href="./yii-console-controllers-cachecontroller.html">CacheController</a>
<a class="list-group-item" href="./yii-console-controllers-fixturecontroller.html">FixtureController</a>
<a class="list-group-item" href="./yii-console-controllers-helpcontroller.html">HelpController</a>
<a class="list-group-item" href="./yii-console-controllers-messagecontroller.html">MessageController</a>
<a class="list-group-item" href="./yii-console-controllers-migratecontroller.html">MigrateController</a>
<a class="list-group-item" href="./yii-console-controllers-servecontroller.html">ServeController</a></div>
<a class="list-group-item" href="#navigation-2218" data-toggle="collapse" data-parent="#navigation">yii\data <b class="caret"></b></a><div id="navigation-2218" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-data-activedataprovider.html">ActiveDataProvider</a>
<a class="list-group-item" href="./yii-data-arraydataprovider.html">ArrayDataProvider</a>
<a class="list-group-item" href="./yii-data-basedataprovider.html">BaseDataProvider</a>
<a class="list-group-item" href="./yii-data-dataproviderinterface.html">DataProviderInterface</a>
<a class="list-group-item" href="./yii-data-pagination.html">Pagination</a>
<a class="list-group-item" href="./yii-data-sort.html">Sort</a>
<a class="list-group-item" href="./yii-data-sqldataprovider.html">SqlDataProvider</a></div>
<a class="list-group-item" href="#navigation-2219" data-toggle="collapse" data-parent="#navigation">yii\db <b class="caret"></b></a><div id="navigation-2219" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-db-activequery.html">ActiveQuery</a>
<a class="list-group-item" href="./yii-db-activequeryinterface.html">ActiveQueryInterface</a>
<a class="list-group-item" href="./yii-db-activequerytrait.html">ActiveQueryTrait</a>
<a class="list-group-item" href="./yii-db-activerecord.html">ActiveRecord</a>
<a class="list-group-item" href="./yii-db-activerecordinterface.html">ActiveRecordInterface</a>
<a class="list-group-item" href="./yii-db-activerelationtrait.html">ActiveRelationTrait</a>
<a class="list-group-item" href="./yii-db-aftersaveevent.html">AfterSaveEvent</a>
<a class="list-group-item" href="./yii-db-baseactiverecord.html">BaseActiveRecord</a>
<a class="list-group-item" href="./yii-db-batchqueryresult.html">BatchQueryResult</a>
<a class="list-group-item" href="./yii-db-columnschema.html">ColumnSchema</a>
<a class="list-group-item" href="./yii-db-columnschemabuilder.html">ColumnSchemaBuilder</a>
<a class="list-group-item" href="./yii-db-command.html">Command</a>
<a class="list-group-item" href="./yii-db-connection.html">Connection</a>
<a class="list-group-item" href="./yii-db-datareader.html">DataReader</a>
<a class="list-group-item" href="./yii-db-exception.html">Exception</a>
<a class="list-group-item" href="./yii-db-expression.html">Expression</a>
<a class="list-group-item" href="./yii-db-integrityexception.html">IntegrityException</a>
<a class="list-group-item" href="./yii-db-migration.html">Migration</a>
<a class="list-group-item" href="./yii-db-migrationinterface.html">MigrationInterface</a>
<a class="list-group-item" href="./yii-db-query.html">Query</a>
<a class="list-group-item" href="./yii-db-querybuilder.html">QueryBuilder</a>
<a class="list-group-item" href="./yii-db-queryinterface.html">QueryInterface</a>
<a class="list-group-item" href="./yii-db-querytrait.html">QueryTrait</a>
<a class="list-group-item" href="./yii-db-schema.html">Schema</a>
<a class="list-group-item" href="./yii-db-schemabuildertrait.html">SchemaBuilderTrait</a>
<a class="list-group-item" href="./yii-db-staleobjectexception.html">StaleObjectException</a>
<a class="list-group-item" href="./yii-db-tableschema.html">TableSchema</a>
<a class="list-group-item" href="./yii-db-transaction.html">Transaction</a></div>
<a class="list-group-item" href="#navigation-2220" data-toggle="collapse" data-parent="#navigation">yii\db\cubrid <b class="caret"></b></a><div id="navigation-2220" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-db-cubrid-columnschemabuilder.html">ColumnSchemaBuilder</a>
<a class="list-group-item" href="./yii-db-cubrid-querybuilder.html">QueryBuilder</a>
<a class="list-group-item" href="./yii-db-cubrid-schema.html">Schema</a></div>
<a class="list-group-item" href="#navigation-2221" data-toggle="collapse" data-parent="#navigation">yii\db\mssql <b class="caret"></b></a><div id="navigation-2221" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-db-mssql-pdo.html">PDO</a>
<a class="list-group-item" href="./yii-db-mssql-querybuilder.html">QueryBuilder</a>
<a class="list-group-item" href="./yii-db-mssql-schema.html">Schema</a>
<a class="list-group-item" href="./yii-db-mssql-sqlsrvpdo.html">SqlsrvPDO</a>
<a class="list-group-item" href="./yii-db-mssql-tableschema.html">TableSchema</a></div>
<a class="list-group-item" href="#navigation-2222" data-toggle="collapse" data-parent="#navigation">yii\db\mysql <b class="caret"></b></a><div id="navigation-2222" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-db-mysql-columnschemabuilder.html">ColumnSchemaBuilder</a>
<a class="list-group-item" href="./yii-db-mysql-querybuilder.html">QueryBuilder</a>
<a class="list-group-item" href="./yii-db-mysql-schema.html">Schema</a></div>
<a class="list-group-item" href="#navigation-2223" data-toggle="collapse" data-parent="#navigation">yii\db\oci <b class="caret"></b></a><div id="navigation-2223" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-db-oci-columnschemabuilder.html">ColumnSchemaBuilder</a>
<a class="list-group-item" href="./yii-db-oci-querybuilder.html">QueryBuilder</a>
<a class="list-group-item" href="./yii-db-oci-schema.html">Schema</a></div>
<a class="list-group-item" href="#navigation-2224" data-toggle="collapse" data-parent="#navigation">yii\db\pgsql <b class="caret"></b></a><div id="navigation-2224" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-db-pgsql-querybuilder.html">QueryBuilder</a>
<a class="list-group-item" href="./yii-db-pgsql-schema.html">Schema</a></div>
<a class="list-group-item" href="#navigation-2225" data-toggle="collapse" data-parent="#navigation">yii\db\sqlite <b class="caret"></b></a><div id="navigation-2225" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-db-sqlite-columnschemabuilder.html">ColumnSchemaBuilder</a>
<a class="list-group-item" href="./yii-db-sqlite-querybuilder.html">QueryBuilder</a>
<a class="list-group-item" href="./yii-db-sqlite-schema.html">Schema</a></div>
<a class="list-group-item" href="#navigation-2226" data-toggle="collapse" data-parent="#navigation">yii\di <b class="caret"></b></a><div id="navigation-2226" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-di-container.html">Container</a>
<a class="list-group-item" href="./yii-di-instance.html">Instance</a>
<a class="list-group-item" href="./yii-di-notinstantiableexception.html">NotInstantiableException</a>
<a class="list-group-item" href="./yii-di-servicelocator.html">ServiceLocator</a></div>
<a class="list-group-item" href="#navigation-2227" data-toggle="collapse" data-parent="#navigation">yii\filters <b class="caret"></b></a><div id="navigation-2227" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-filters-accesscontrol.html">AccessControl</a>
<a class="list-group-item" href="./yii-filters-accessrule.html">AccessRule</a>
<a class="list-group-item" href="./yii-filters-contentnegotiator.html">ContentNegotiator</a>
<a class="list-group-item" href="./yii-filters-cors.html">Cors</a>
<a class="list-group-item" href="./yii-filters-httpcache.html">HttpCache</a>
<a class="list-group-item" href="./yii-filters-pagecache.html">PageCache</a>
<a class="list-group-item" href="./yii-filters-ratelimitinterface.html">RateLimitInterface</a>
<a class="list-group-item" href="./yii-filters-ratelimiter.html">RateLimiter</a>
<a class="list-group-item" href="./yii-filters-verbfilter.html">VerbFilter</a></div>
<a class="list-group-item" href="#navigation-2228" data-toggle="collapse" data-parent="#navigation">yii\filters\auth <b class="caret"></b></a><div id="navigation-2228" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-filters-auth-authinterface.html">AuthInterface</a>
<a class="list-group-item" href="./yii-filters-auth-authmethod.html">AuthMethod</a>
<a class="list-group-item" href="./yii-filters-auth-compositeauth.html">CompositeAuth</a>
<a class="list-group-item" href="./yii-filters-auth-httpbasicauth.html">HttpBasicAuth</a>
<a class="list-group-item" href="./yii-filters-auth-httpbearerauth.html">HttpBearerAuth</a>
<a class="list-group-item" href="./yii-filters-auth-queryparamauth.html">QueryParamAuth</a></div>
<a class="list-group-item" href="#navigation-2229" data-toggle="collapse" data-parent="#navigation">yii\grid <b class="caret"></b></a><div id="navigation-2229" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-grid-actioncolumn.html">ActionColumn</a>
<a class="list-group-item" href="./yii-grid-checkboxcolumn.html">CheckboxColumn</a>
<a class="list-group-item" href="./yii-grid-column.html">Column</a>
<a class="list-group-item" href="./yii-grid-datacolumn.html">DataColumn</a>
<a class="list-group-item" href="./yii-grid-gridview.html">GridView</a>
<a class="list-group-item" href="./yii-grid-gridviewasset.html">GridViewAsset</a>
<a class="list-group-item" href="./yii-grid-serialcolumn.html">SerialColumn</a></div>
<a class="list-group-item" href="#navigation-2230" data-toggle="collapse" data-parent="#navigation">yii\helpers <b class="caret"></b></a><div id="navigation-2230" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-helpers-arrayhelper.html">ArrayHelper</a>
<a class="list-group-item" href="./yii-helpers-basearrayhelper.html">BaseArrayHelper</a>
<a class="list-group-item" href="./yii-helpers-baseconsole.html">BaseConsole</a>
<a class="list-group-item" href="./yii-helpers-basefilehelper.html">BaseFileHelper</a>
<a class="list-group-item" href="./yii-helpers-baseformatconverter.html">BaseFormatConverter</a>
<a class="list-group-item" href="./yii-helpers-basehtml.html">BaseHtml</a>
<a class="list-group-item" href="./yii-helpers-basehtmlpurifier.html">BaseHtmlPurifier</a>
<a class="list-group-item" href="./yii-helpers-baseinflector.html">BaseInflector</a>
<a class="list-group-item" href="./yii-helpers-basejson.html">BaseJson</a>
<a class="list-group-item" href="./yii-helpers-basemarkdown.html">BaseMarkdown</a>
<a class="list-group-item" href="./yii-helpers-basestringhelper.html">BaseStringHelper</a>
<a class="list-group-item" href="./yii-helpers-baseurl.html">BaseUrl</a>
<a class="list-group-item" href="./yii-helpers-basevardumper.html">BaseVarDumper</a>
<a class="list-group-item" href="./yii-helpers-console.html">Console</a>
<a class="list-group-item" href="./yii-helpers-filehelper.html">FileHelper</a>
<a class="list-group-item" href="./yii-helpers-formatconverter.html">FormatConverter</a>
<a class="list-group-item" href="./yii-helpers-html.html">Html</a>
<a class="list-group-item" href="./yii-helpers-htmlpurifier.html">HtmlPurifier</a>
<a class="list-group-item" href="./yii-helpers-inflector.html">Inflector</a>
<a class="list-group-item" href="./yii-helpers-json.html">Json</a>
<a class="list-group-item" href="./yii-helpers-markdown.html">Markdown</a>
<a class="list-group-item" href="./yii-helpers-stringhelper.html">StringHelper</a>
<a class="list-group-item" href="./yii-helpers-url.html">Url</a>
<a class="list-group-item" href="./yii-helpers-vardumper.html">VarDumper</a></div>
<a class="list-group-item" href="#navigation-2231" data-toggle="collapse" data-parent="#navigation">yii\i18n <b class="caret"></b></a><div id="navigation-2231" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-i18n-dbmessagesource.html">DbMessageSource</a>
<a class="list-group-item" href="./yii-i18n-formatter.html">Formatter</a>
<a class="list-group-item" href="./yii-i18n-gettextfile.html">GettextFile</a>
<a class="list-group-item" href="./yii-i18n-gettextmessagesource.html">GettextMessageSource</a>
<a class="list-group-item" href="./yii-i18n-gettextmofile.html">GettextMoFile</a>
<a class="list-group-item" href="./yii-i18n-gettextpofile.html">GettextPoFile</a>
<a class="list-group-item" href="./yii-i18n-i18n.html">I18N</a>
<a class="list-group-item" href="./yii-i18n-messageformatter.html">MessageFormatter</a>
<a class="list-group-item" href="./yii-i18n-messagesource.html">MessageSource</a>
<a class="list-group-item" href="./yii-i18n-missingtranslationevent.html">MissingTranslationEvent</a>
<a class="list-group-item" href="./yii-i18n-phpmessagesource.html">PhpMessageSource</a></div>
<a class="list-group-item" href="#navigation-2232" data-toggle="collapse" data-parent="#navigation">yii\log <b class="caret"></b></a><div id="navigation-2232" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-log-dbtarget.html">DbTarget</a>
<a class="list-group-item" href="./yii-log-dispatcher.html">Dispatcher</a>
<a class="list-group-item" href="./yii-log-emailtarget.html">EmailTarget</a>
<a class="list-group-item" href="./yii-log-filetarget.html">FileTarget</a>
<a class="list-group-item" href="./yii-log-logger.html">Logger</a>
<a class="list-group-item" href="./yii-log-syslogtarget.html">SyslogTarget</a>
<a class="list-group-item" href="./yii-log-target.html">Target</a></div>
<a class="list-group-item" href="#navigation-2233" data-toggle="collapse" data-parent="#navigation">yii\mail <b class="caret"></b></a><div id="navigation-2233" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mail-basemailer.html">BaseMailer</a>
<a class="list-group-item" href="./yii-mail-basemessage.html">BaseMessage</a>
<a class="list-group-item" href="./yii-mail-mailevent.html">MailEvent</a>
<a class="list-group-item" href="./yii-mail-mailerinterface.html">MailerInterface</a>
<a class="list-group-item" href="./yii-mail-messageinterface.html">MessageInterface</a></div>
<a class="list-group-item" href="#navigation-2234" data-toggle="collapse" data-parent="#navigation">yii\mutex <b class="caret"></b></a><div id="navigation-2234" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mutex-dbmutex.html">DbMutex</a>
<a class="list-group-item" href="./yii-mutex-filemutex.html">FileMutex</a>
<a class="list-group-item" href="./yii-mutex-mutex.html">Mutex</a>
<a class="list-group-item" href="./yii-mutex-mysqlmutex.html">MysqlMutex</a>
<a class="list-group-item" href="./yii-mutex-pgsqlmutex.html">PgsqlMutex</a></div>
<a class="list-group-item" href="#navigation-2235" data-toggle="collapse" data-parent="#navigation">yii\rbac <b class="caret"></b></a><div id="navigation-2235" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-rbac-assignment.html">Assignment</a>
<a class="list-group-item" href="./yii-rbac-basemanager.html">BaseManager</a>
<a class="list-group-item" href="./yii-rbac-checkaccessinterface.html">CheckAccessInterface</a>
<a class="list-group-item" href="./yii-rbac-dbmanager.html">DbManager</a>
<a class="list-group-item" href="./yii-rbac-item.html">Item</a>
<a class="list-group-item" href="./yii-rbac-managerinterface.html">ManagerInterface</a>
<a class="list-group-item" href="./yii-rbac-permission.html">Permission</a>
<a class="list-group-item" href="./yii-rbac-phpmanager.html">PhpManager</a>
<a class="list-group-item" href="./yii-rbac-role.html">Role</a>
<a class="list-group-item" href="./yii-rbac-rule.html">Rule</a></div>
<a class="list-group-item" href="#navigation-2236" data-toggle="collapse" data-parent="#navigation">yii\rest <b class="caret"></b></a><div id="navigation-2236" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-rest-action.html">Action</a>
<a class="list-group-item" href="./yii-rest-activecontroller.html">ActiveController</a>
<a class="list-group-item" href="./yii-rest-controller.html">Controller</a>
<a class="list-group-item" href="./yii-rest-createaction.html">CreateAction</a>
<a class="list-group-item" href="./yii-rest-deleteaction.html">DeleteAction</a>
<a class="list-group-item" href="./yii-rest-indexaction.html">IndexAction</a>
<a class="list-group-item" href="./yii-rest-optionsaction.html">OptionsAction</a>
<a class="list-group-item" href="./yii-rest-serializer.html">Serializer</a>
<a class="list-group-item" href="./yii-rest-updateaction.html">UpdateAction</a>
<a class="list-group-item" href="./yii-rest-urlrule.html">UrlRule</a>
<a class="list-group-item" href="./yii-rest-viewaction.html">ViewAction</a></div>
<a class="list-group-item" href="#navigation-2237" data-toggle="collapse" data-parent="#navigation">yii\test <b class="caret"></b></a><div id="navigation-2237" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-test-activefixture.html">ActiveFixture</a>
<a class="list-group-item" href="./yii-test-arrayfixture.html">ArrayFixture</a>
<a class="list-group-item" href="./yii-test-baseactivefixture.html">BaseActiveFixture</a>
<a class="list-group-item" href="./yii-test-dbfixture.html">DbFixture</a>
<a class="list-group-item" href="./yii-test-fixture.html">Fixture</a>
<a class="list-group-item" href="./yii-test-fixturetrait.html">FixtureTrait</a>
<a class="list-group-item" href="./yii-test-initdbfixture.html">InitDbFixture</a></div>
<a class="list-group-item" href="#navigation-2238" data-toggle="collapse" data-parent="#navigation">yii\validators <b class="caret"></b></a><div id="navigation-2238" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-validators-booleanvalidator.html">BooleanValidator</a>
<a class="list-group-item" href="./yii-validators-comparevalidator.html">CompareValidator</a>
<a class="list-group-item" href="./yii-validators-datevalidator.html">DateValidator</a>
<a class="list-group-item" href="./yii-validators-defaultvaluevalidator.html">DefaultValueValidator</a>
<a class="list-group-item" href="./yii-validators-eachvalidator.html">EachValidator</a>
<a class="list-group-item" href="./yii-validators-emailvalidator.html">EmailValidator</a>
<a class="list-group-item" href="./yii-validators-existvalidator.html">ExistValidator</a>
<a class="list-group-item" href="./yii-validators-filevalidator.html">FileValidator</a>
<a class="list-group-item" href="./yii-validators-filtervalidator.html">FilterValidator</a>
<a class="list-group-item" href="./yii-validators-imagevalidator.html">ImageValidator</a>
<a class="list-group-item" href="./yii-validators-inlinevalidator.html">InlineValidator</a>
<a class="list-group-item" href="./yii-validators-ipvalidator.html">IpValidator</a>
<a class="list-group-item" href="./yii-validators-numbervalidator.html">NumberValidator</a>
<a class="list-group-item" href="./yii-validators-punycodeasset.html">PunycodeAsset</a>
<a class="list-group-item" href="./yii-validators-rangevalidator.html">RangeValidator</a>
<a class="list-group-item" href="./yii-validators-regularexpressionvalidator.html">RegularExpressionValidator</a>
<a class="list-group-item" href="./yii-validators-requiredvalidator.html">RequiredValidator</a>
<a class="list-group-item" href="./yii-validators-safevalidator.html">SafeValidator</a>
<a class="list-group-item" href="./yii-validators-stringvalidator.html">StringValidator</a>
<a class="list-group-item" href="./yii-validators-uniquevalidator.html">UniqueValidator</a>
<a class="list-group-item" href="./yii-validators-urlvalidator.html">UrlValidator</a>
<a class="list-group-item" href="./yii-validators-validationasset.html">ValidationAsset</a>
<a class="list-group-item" href="./yii-validators-validator.html">Validator</a></div>
<a class="list-group-item" href="#navigation-2239" data-toggle="collapse" data-parent="#navigation">yii\web <b class="caret"></b></a><div id="navigation-2239" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-web-application.html">Application</a>
<a class="list-group-item" href="./yii-web-assetbundle.html">AssetBundle</a>
<a class="list-group-item" href="./yii-web-assetconverter.html">AssetConverter</a>
<a class="list-group-item" href="./yii-web-assetconverterinterface.html">AssetConverterInterface</a>
<a class="list-group-item" href="./yii-web-assetmanager.html">AssetManager</a>
<a class="list-group-item" href="./yii-web-badrequesthttpexception.html">BadRequestHttpException</a>
<a class="list-group-item" href="./yii-web-cachesession.html">CacheSession</a>
<a class="list-group-item" href="./yii-web-compositeurlrule.html">CompositeUrlRule</a>
<a class="list-group-item" href="./yii-web-conflicthttpexception.html">ConflictHttpException</a>
<a class="list-group-item" href="./yii-web-controller.html">Controller</a>
<a class="list-group-item" href="./yii-web-cookie.html">Cookie</a>
<a class="list-group-item" href="./yii-web-cookiecollection.html">CookieCollection</a>
<a class="list-group-item" href="./yii-web-dbsession.html">DbSession</a>
<a class="list-group-item" href="./yii-web-erroraction.html">ErrorAction</a>
<a class="list-group-item" href="./yii-web-errorhandler.html">ErrorHandler</a>
<a class="list-group-item" href="./yii-web-forbiddenhttpexception.html">ForbiddenHttpException</a>
<a class="list-group-item" href="./yii-web-gonehttpexception.html">GoneHttpException</a>
<a class="list-group-item" href="./yii-web-groupurlrule.html">GroupUrlRule</a>
<a class="list-group-item" href="./yii-web-headercollection.html">HeaderCollection</a>
<a class="list-group-item" href="./yii-web-htmlresponseformatter.html">HtmlResponseFormatter</a>
<a class="list-group-item" href="./yii-web-httpexception.html">HttpException</a>
<a class="list-group-item" href="./yii-web-identityinterface.html">IdentityInterface</a>
<a class="list-group-item" href="./yii-web-jqueryasset.html">JqueryAsset</a>
<a class="list-group-item" href="./yii-web-jsexpression.html">JsExpression</a>
<a class="list-group-item" href="./yii-web-jsonparser.html">JsonParser</a>
<a class="list-group-item" href="./yii-web-jsonresponseformatter.html">JsonResponseFormatter</a>
<a class="list-group-item" href="./yii-web-link.html">Link</a>
<a class="list-group-item" href="./yii-web-linkable.html">Linkable</a>
<a class="list-group-item" href="./yii-web-methodnotallowedhttpexception.html">MethodNotAllowedHttpException</a>
<a class="list-group-item" href="./yii-web-multifieldsession.html">MultiFieldSession</a>
<a class="list-group-item" href="./yii-web-notacceptablehttpexception.html">NotAcceptableHttpException</a>
<a class="list-group-item" href="./yii-web-notfoundhttpexception.html">NotFoundHttpException</a>
<a class="list-group-item" href="./yii-web-request.html">Request</a>
<a class="list-group-item" href="./yii-web-requestparserinterface.html">RequestParserInterface</a>
<a class="list-group-item" href="./yii-web-response.html">Response</a>
<a class="list-group-item" href="./yii-web-responseformatterinterface.html">ResponseFormatterInterface</a>
<a class="list-group-item" href="./yii-web-servererrorhttpexception.html">ServerErrorHttpException</a>
<a class="list-group-item" href="./yii-web-session.html">Session</a>
<a class="list-group-item" href="./yii-web-sessioniterator.html">SessionIterator</a>
<a class="list-group-item" href="./yii-web-toomanyrequestshttpexception.html">TooManyRequestsHttpException</a>
<a class="list-group-item" href="./yii-web-unauthorizedhttpexception.html">UnauthorizedHttpException</a>
<a class="list-group-item" href="./yii-web-unprocessableentityhttpexception.html">UnprocessableEntityHttpException</a>
<a class="list-group-item" href="./yii-web-unsupportedmediatypehttpexception.html">UnsupportedMediaTypeHttpException</a>
<a class="list-group-item" href="./yii-web-uploadedfile.html">UploadedFile</a>
<a class="list-group-item" href="./yii-web-urlmanager.html">UrlManager</a>
<a class="list-group-item" href="./yii-web-urlrule.html">UrlRule</a>
<a class="list-group-item" href="./yii-web-urlruleinterface.html">UrlRuleInterface</a>
<a class="list-group-item" href="./yii-web-user.html">User</a>
<a class="list-group-item" href="./yii-web-userevent.html">UserEvent</a>
<a class="list-group-item" href="./yii-web-view.html">View</a>
<a class="list-group-item" href="./yii-web-viewaction.html">ViewAction</a>
<a class="list-group-item" href="./yii-web-xmlresponseformatter.html">XmlResponseFormatter</a>
<a class="list-group-item" href="./yii-web-yiiasset.html">YiiAsset</a></div>
<a class="list-group-item" href="#navigation-2240" data-toggle="collapse" data-parent="#navigation">yii\widgets <b class="caret"></b></a><div id="navigation-2240" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-widgets-activefield.html">ActiveField</a>
<a class="list-group-item" href="./yii-widgets-activeform.html">ActiveForm</a>
<a class="list-group-item" href="./yii-widgets-activeformasset.html">ActiveFormAsset</a>
<a class="list-group-item" href="./yii-widgets-baselistview.html">BaseListView</a>
<a class="list-group-item" href="./yii-widgets-block.html">Block</a>
<a class="list-group-item" href="./yii-widgets-breadcrumbs.html">Breadcrumbs</a>
<a class="list-group-item" href="./yii-widgets-contentdecorator.html">ContentDecorator</a>
<a class="list-group-item" href="./yii-widgets-detailview.html">DetailView</a>
<a class="list-group-item" href="./yii-widgets-fragmentcache.html">FragmentCache</a>
<a class="list-group-item" href="./yii-widgets-inputwidget.html">InputWidget</a>
<a class="list-group-item" href="./yii-widgets-linkpager.html">LinkPager</a>
<a class="list-group-item" href="./yii-widgets-linksorter.html">LinkSorter</a>
<a class="list-group-item" href="./yii-widgets-listview.html">ListView</a>
<a class="list-group-item" href="./yii-widgets-maskedinput.html">MaskedInput</a>
<a class="list-group-item" href="./yii-widgets-maskedinputasset.html">MaskedInputAsset</a>
<a class="list-group-item" href="./yii-widgets-menu.html">Menu</a>
<a class="list-group-item" href="./yii-widgets-pjax.html">Pjax</a>
<a class="list-group-item" href="./yii-widgets-pjaxasset.html">PjaxAsset</a>
<a class="list-group-item" href="./yii-widgets-spaceless.html">Spaceless</a></div></div>    </div>
    <div class="col-md-9 api-content" role="main">
        <h1>Class yii\base\Model</h1>
<div class="top-nav">
    <a href="index.html">All Classes</a>
            | <a href="#properties">Properties</a>
                | <a href="#methods">Methods</a>
                | <a href="#events">Events</a>
                | <a href="#constants">Constants</a>
    </div>

<table class="summaryTable docClass table table-bordered">
    <colgroup>
        <col class="col-name" />
        <col class="col-value" />
    </colgroup>
            <tr><th>Inheritance</th><td><a href="yii-base-model.html">yii\base\Model</a> &raquo;
<a href="yii-base-component.html">yii\base\Component</a> &raquo;
<a href="yii-base-object.html">yii\base\Object</a></td></tr>
                <tr><th>Implements</th><td><a href="http://www.php.net/class.arrayaccess">ArrayAccess</a>, <a href="http://www.php.net/class.iteratoraggregate">IteratorAggregate</a>, <a href="yii-base-arrayable.html">yii\base\Arrayable</a>, <a href="yii-base-configurable.html">yii\base\Configurable</a></td></tr>
                    <tr><th>Uses Traits</th><td><a href="yii-base-arrayabletrait.html">yii\base\ArrayableTrait</a></td></tr>
                <tr><th>Subclasses</th><td><a href="yii-base-dynamicmodel.html">yii\base\DynamicModel</a>, <a href="yii-db-activerecord.html">yii\db\ActiveRecord</a>, <a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a>, <a href="yii-debug-models-search-base.html">yii\debug\models\search\Base</a>, <a href="yii-debug-models-search-db.html">yii\debug\models\search\Db</a>, <a href="yii-debug-models-search-debug.html">yii\debug\models\search\Debug</a>, <a href="yii-debug-models-search-log.html">yii\debug\models\search\Log</a>, <a href="yii-debug-models-search-mail.html">yii\debug\models\search\Mail</a>, <a href="yii-debug-models-search-profile.html">yii\debug\models\search\Profile</a>, <a href="yii-elasticsearch-activerecord.html">yii\elasticsearch\ActiveRecord</a>, <a href="yii-gii-generator.html">yii\gii\Generator</a>, <a href="yii-gii-generators-controller-generator.html">yii\gii\generators\controller\Generator</a>, <a href="yii-gii-generators-crud-generator.html">yii\gii\generators\crud\Generator</a>, <a href="yii-gii-generators-extension-generator.html">yii\gii\generators\extension\Generator</a>, <a href="yii-gii-generators-form-generator.html">yii\gii\generators\form\Generator</a>, <a href="yii-gii-generators-model-generator.html">yii\gii\generators\model\Generator</a>, <a href="yii-gii-generators-module-generator.html">yii\gii\generators\module\Generator</a>, <a href="yii-mongodb-activerecord.html">yii\mongodb\ActiveRecord</a>, <a href="yii-mongodb-file-activerecord.html">yii\mongodb\file\ActiveRecord</a>, <a href="yii-mongodb-gii-model-generator.html">yii\mongodb\gii\model\Generator</a>, <a href="yii-redis-activerecord.html">yii\redis\ActiveRecord</a>, <a href="yii-sphinx-activerecord.html">yii\sphinx\ActiveRecord</a>, <a href="yii-sphinx-gii-model-generator.html">yii\sphinx\gii\model\Generator</a></td></tr>
                        <tr><th>Available since version</th><td>2.0</td></tr>
                    <tr>
          <th>Source Code</th>
          <td><a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php">https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php</a></td>
        </tr>
    </table>

<div class="class-description">
    <p><strong>Model is the base class for data models.</strong></p>
    <p>Model implements the following commonly used features:</p>
<ul>
<li>attribute declaration: by default, every public class member is considered as
a model attribute</li>
<li>attribute labels: each attribute may be associated with a label for display purpose</li>
<li>massive attribute assignment</li>
<li>scenario-based validation</li>
</ul>
<p>Model also raises the following events when performing data validation:</p>
<ul>
<li><a href="yii-base-model.html#EVENT_BEFORE_VALIDATE-detail">EVENT_BEFORE_VALIDATE</a>: an event raised at the beginning of <a href="yii-base-model.html#validate()-detail">validate()</a></li>
<li><a href="yii-base-model.html#EVENT_AFTER_VALIDATE-detail">EVENT_AFTER_VALIDATE</a>: an event raised at the end of <a href="yii-base-model.html#validate()-detail">validate()</a></li>
</ul>
<p>You may directly use Model to store model data, or extend it with customization.</p>

    </div>

<a id="properties"></a>

<div class="summary doc-property">
<h2>Public Properties</h2>

<p><a href="#" class="toggle">Hide inherited properties</a></p>

<table class="summary-table table table-striped table-bordered table-hover">
<colgroup>
    <col class="col-property" />
    <col class="col-type" />
    <col class="col-description" />
    <col class="col-defined" />
</colgroup>
<tr>
  <th>Property</th><th>Type</th><th>Description</th><th>Defined By</th>
</tr>
        <tr id="$activeValidators">
        <td><a href="yii-base-model.html#$activeValidators-detail">$activeValidators</a></td>
        <td><a href="yii-validators-validator.html">yii\validators\Validator</a>[]</td>
        <td>The validators applicable to the current <a href="yii-base-model.html#$scenario-detail">$scenario</a>.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="$attributes">
        <td><a href="yii-base-model.html#$attributes-detail">$attributes</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>Attribute values (name =&gt; value).</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="$behaviors">
        <td><a href="yii-base-component.html#$behaviors-detail">$behaviors</a></td>
        <td><a href="yii-base-behavior.html">yii\base\Behavior</a>[]</td>
        <td>List of behaviors attached to this component</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr id="$errors">
        <td><a href="yii-base-model.html#$errors-detail">$errors</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>Errors for all attributes or the specified attribute.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="$firstErrors">
        <td><a href="yii-base-model.html#$firstErrors-detail">$firstErrors</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>The first errors.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="$iterator">
        <td><a href="yii-base-model.html#$iterator-detail">$iterator</a></td>
        <td><a href="http://www.php.net/class.arrayiterator">ArrayIterator</a></td>
        <td>An iterator for traversing the items in the list.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="$scenario">
        <td><a href="yii-base-model.html#$scenario-detail">$scenario</a></td>
        <td><a href="http://www.php.net/language.types.string">string</a></td>
        <td>The scenario that this model is in.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="$validators">
        <td><a href="yii-base-model.html#$validators-detail">$validators</a></td>
        <td><a href="http://www.php.net/class.arrayobject">ArrayObject</a>|<a href="yii-validators-validator.html">yii\validators\Validator</a>[]</td>
        <td>All the validators declared in the model.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
    </table>
</div>

<a id="methods"></a>

<div class="summary doc-method">
<h2>Public Methods</h2>

<p><a href="#" class="toggle">Hide inherited methods</a></p>

<table class="summary-table table table-striped table-bordered table-hover">
<colgroup>
    <col class="col-method" />
    <col class="col-description" />
    <col class="col-defined" />
</colgroup>
<tr>
  <th>Method</th><th>Description</th><th>Defined By</th>
</tr>
        <tr class="inherited" id="__call()">
        <td><a href="yii-base-object.html#__call()-detail">__call()</a></td>
        <td>Calls the named method which is not a class method.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="__clone()">
        <td><a href="yii-base-component.html#__clone()-detail">__clone()</a></td>
        <td>This method is called after the object is created by cloning an existing one.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="__construct()">
        <td><a href="yii-base-object.html#__construct()-detail">__construct()</a></td>
        <td>Constructor.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="__get()">
        <td><a href="yii-base-object.html#__get()-detail">__get()</a></td>
        <td>Returns the value of an object property.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="__isset()">
        <td><a href="yii-base-object.html#__isset()-detail">__isset()</a></td>
        <td>Checks if a property is set, i.e. defined and not null.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="__set()">
        <td><a href="yii-base-object.html#__set()-detail">__set()</a></td>
        <td>Sets value of an object property.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="__unset()">
        <td><a href="yii-base-object.html#__unset()-detail">__unset()</a></td>
        <td>Sets an object property to null.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr id="activeAttributes()">
        <td><a href="yii-base-model.html#activeAttributes()-detail">activeAttributes()</a></td>
        <td>Returns the attribute names that are subject to validation in the current scenario.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="addError()">
        <td><a href="yii-base-model.html#addError()-detail">addError()</a></td>
        <td>Adds a new error to the specified attribute.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="addErrors()">
        <td><a href="yii-base-model.html#addErrors()-detail">addErrors()</a></td>
        <td>Adds a list of errors.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="afterValidate()">
        <td><a href="yii-base-model.html#afterValidate()-detail">afterValidate()</a></td>
        <td>This method is invoked after validation ends.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="attachBehavior()">
        <td><a href="yii-base-component.html#attachBehavior()-detail">attachBehavior()</a></td>
        <td>Attaches a behavior to this component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="attachBehaviors()">
        <td><a href="yii-base-component.html#attachBehaviors()-detail">attachBehaviors()</a></td>
        <td>Attaches a list of behaviors to the component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr id="attributeHints()">
        <td><a href="yii-base-model.html#attributeHints()-detail">attributeHints()</a></td>
        <td>Returns the attribute hints.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="attributeLabels()">
        <td><a href="yii-base-model.html#attributeLabels()-detail">attributeLabels()</a></td>
        <td>Returns the attribute labels.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="attributes()">
        <td><a href="yii-base-model.html#attributes()-detail">attributes()</a></td>
        <td>Returns the list of attribute names.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="beforeValidate()">
        <td><a href="yii-base-model.html#beforeValidate()-detail">beforeValidate()</a></td>
        <td>This method is invoked before validation starts.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="behaviors()">
        <td><a href="yii-base-component.html#behaviors()-detail">behaviors()</a></td>
        <td>Returns a list of behaviors that this component should behave as.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="canGetProperty()">
        <td><a href="yii-base-object.html#canGetProperty()-detail">canGetProperty()</a></td>
        <td>Returns a value indicating whether a property can be read.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="canSetProperty()">
        <td><a href="yii-base-object.html#canSetProperty()-detail">canSetProperty()</a></td>
        <td>Returns a value indicating whether a property can be set.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="className()">
        <td><a href="yii-base-object.html#className()-detail">className()</a></td>
        <td>Returns the fully qualified name of this class.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr id="clearErrors()">
        <td><a href="yii-base-model.html#clearErrors()-detail">clearErrors()</a></td>
        <td>Removes errors for all attributes or a single attribute.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="createValidators()">
        <td><a href="yii-base-model.html#createValidators()-detail">createValidators()</a></td>
        <td>Creates validator objects based on the validation rules specified in <a href="yii-base-model.html#rules()-detail">rules()</a>.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="detachBehavior()">
        <td><a href="yii-base-component.html#detachBehavior()-detail">detachBehavior()</a></td>
        <td>Detaches a behavior from the component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="detachBehaviors()">
        <td><a href="yii-base-component.html#detachBehaviors()-detail">detachBehaviors()</a></td>
        <td>Detaches all behaviors from the component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="ensureBehaviors()">
        <td><a href="yii-base-component.html#ensureBehaviors()-detail">ensureBehaviors()</a></td>
        <td>Makes sure that the behaviors declared in <a href="yii-base-component.html#behaviors()-detail">behaviors()</a> are attached to this component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="extraFields()">
        <td><a href="yii-base-arrayabletrait.html#extraFields()-detail">extraFields()</a></td>
        <td>Returns the list of fields that can be expanded further and returned by <a href="yii-base-arrayabletrait.html#toArray()-detail">toArray()</a>.</td>
        <td><a href="yii-base-arrayabletrait.html">yii\base\ArrayableTrait</a></td>
    </tr>
            <tr id="fields()">
        <td><a href="yii-base-model.html#fields()-detail">fields()</a></td>
        <td>Returns the list of fields that should be returned by default by <a href="yii-base-arrayabletrait.html#toArray()-detail">toArray()</a> when no specific fields are specified.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="formName()">
        <td><a href="yii-base-model.html#formName()-detail">formName()</a></td>
        <td>Returns the form name that this model class should use.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="generateAttributeLabel()">
        <td><a href="yii-base-model.html#generateAttributeLabel()-detail">generateAttributeLabel()</a></td>
        <td>Generates a user friendly attribute label based on the give attribute name.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="getActiveValidators()">
        <td><a href="yii-base-model.html#getActiveValidators()-detail">getActiveValidators()</a></td>
        <td>Returns the validators applicable to the current <a href="yii-base-model.html#$scenario-detail">$scenario</a>.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="getAttributeHint()">
        <td><a href="yii-base-model.html#getAttributeHint()-detail">getAttributeHint()</a></td>
        <td>Returns the text hint for the specified attribute.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="getAttributeLabel()">
        <td><a href="yii-base-model.html#getAttributeLabel()-detail">getAttributeLabel()</a></td>
        <td>Returns the text label for the specified attribute.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="getAttributes()">
        <td><a href="yii-base-model.html#getAttributes()-detail">getAttributes()</a></td>
        <td>Returns attribute values.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="getBehavior()">
        <td><a href="yii-base-component.html#getBehavior()-detail">getBehavior()</a></td>
        <td>Returns the named behavior object.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="getBehaviors()">
        <td><a href="yii-base-component.html#getBehaviors()-detail">getBehaviors()</a></td>
        <td>Returns all behaviors attached to this component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr id="getErrors()">
        <td><a href="yii-base-model.html#getErrors()-detail">getErrors()</a></td>
        <td>Returns the errors for all attribute or a single attribute.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="getFirstError()">
        <td><a href="yii-base-model.html#getFirstError()-detail">getFirstError()</a></td>
        <td>Returns the first error of the specified attribute.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="getFirstErrors()">
        <td><a href="yii-base-model.html#getFirstErrors()-detail">getFirstErrors()</a></td>
        <td>Returns the first error of every attribute in the model.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="getIterator()">
        <td><a href="yii-base-model.html#getIterator()-detail">getIterator()</a></td>
        <td>Returns an iterator for traversing the attributes in the model.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="getScenario()">
        <td><a href="yii-base-model.html#getScenario()-detail">getScenario()</a></td>
        <td>Returns the scenario that this model is used in.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="getValidators()">
        <td><a href="yii-base-model.html#getValidators()-detail">getValidators()</a></td>
        <td>Returns all the validators declared in <a href="yii-base-model.html#rules()-detail">rules()</a>.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="hasErrors()">
        <td><a href="yii-base-model.html#hasErrors()-detail">hasErrors()</a></td>
        <td>Returns a value indicating whether there is any validation error.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="hasEventHandlers()">
        <td><a href="yii-base-component.html#hasEventHandlers()-detail">hasEventHandlers()</a></td>
        <td>Returns a value indicating whether there is any handler attached to the named event.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="hasMethod()">
        <td><a href="yii-base-object.html#hasMethod()-detail">hasMethod()</a></td>
        <td>Returns a value indicating whether a method is defined.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="hasProperty()">
        <td><a href="yii-base-object.html#hasProperty()-detail">hasProperty()</a></td>
        <td>Returns a value indicating whether a property is defined.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="init()">
        <td><a href="yii-base-object.html#init()-detail">init()</a></td>
        <td>Initializes the object.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr id="isAttributeActive()">
        <td><a href="yii-base-model.html#isAttributeActive()-detail">isAttributeActive()</a></td>
        <td>Returns a value indicating whether the attribute is active in the current scenario.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="isAttributeRequired()">
        <td><a href="yii-base-model.html#isAttributeRequired()-detail">isAttributeRequired()</a></td>
        <td>Returns a value indicating whether the attribute is required.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="isAttributeSafe()">
        <td><a href="yii-base-model.html#isAttributeSafe()-detail">isAttributeSafe()</a></td>
        <td>Returns a value indicating whether the attribute is safe for massive assignments.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="load()">
        <td><a href="yii-base-model.html#load()-detail">load()</a></td>
        <td>Populates the model with input data.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="loadMultiple()">
        <td><a href="yii-base-model.html#loadMultiple()-detail">loadMultiple()</a></td>
        <td>Populates a set of models with the data from end user.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="off()">
        <td><a href="yii-base-component.html#off()-detail">off()</a></td>
        <td>Detaches an existing event handler from this component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr id="offsetExists()">
        <td><a href="yii-base-model.html#offsetExists()-detail">offsetExists()</a></td>
        <td>Returns whether there is an element at the specified offset.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="offsetGet()">
        <td><a href="yii-base-model.html#offsetGet()-detail">offsetGet()</a></td>
        <td>Returns the element at the specified offset.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="offsetSet()">
        <td><a href="yii-base-model.html#offsetSet()-detail">offsetSet()</a></td>
        <td>Sets the element at the specified offset.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="offsetUnset()">
        <td><a href="yii-base-model.html#offsetUnset()-detail">offsetUnset()</a></td>
        <td>Sets the element value at the specified offset to null.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="on()">
        <td><a href="yii-base-component.html#on()-detail">on()</a></td>
        <td>Attaches an event handler to an event.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr id="onUnsafeAttribute()">
        <td><a href="yii-base-model.html#onUnsafeAttribute()-detail">onUnsafeAttribute()</a></td>
        <td>This method is invoked when an unsafe attribute is being massively assigned.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
                <tr id="rules()">
        <td><a href="yii-base-model.html#rules()-detail">rules()</a></td>
        <td>Returns the validation rules for attributes.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="safeAttributes()">
        <td><a href="yii-base-model.html#safeAttributes()-detail">safeAttributes()</a></td>
        <td>Returns the attribute names that are safe to be massively assigned in the current scenario.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="scenarios()">
        <td><a href="yii-base-model.html#scenarios()-detail">scenarios()</a></td>
        <td>Returns a list of scenarios and the corresponding active attributes.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="setAttributes()">
        <td><a href="yii-base-model.html#setAttributes()-detail">setAttributes()</a></td>
        <td>Sets the attribute values in a massive way.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="setScenario()">
        <td><a href="yii-base-model.html#setScenario()-detail">setScenario()</a></td>
        <td>Sets the scenario for the model.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="toArray()">
        <td><a href="yii-base-arrayabletrait.html#toArray()-detail">toArray()</a></td>
        <td>Converts the model into an array.</td>
        <td><a href="yii-base-arrayabletrait.html">yii\base\ArrayableTrait</a></td>
    </tr>
            <tr class="inherited" id="trigger()">
        <td><a href="yii-base-component.html#trigger()-detail">trigger()</a></td>
        <td>Triggers an event.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr id="validate()">
        <td><a href="yii-base-model.html#validate()-detail">validate()</a></td>
        <td>Performs the data validation.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="validateMultiple()">
        <td><a href="yii-base-model.html#validateMultiple()-detail">validateMultiple()</a></td>
        <td>Validates multiple models.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
    </table>
</div>

<div class="summary doc-method">
<h2>Protected Methods</h2>

<p><a href="#" class="toggle">Hide inherited methods</a></p>

<table class="summary-table table table-striped table-bordered table-hover">
<colgroup>
    <col class="col-method" />
    <col class="col-description" />
    <col class="col-defined" />
</colgroup>
<tr>
  <th>Method</th><th>Description</th><th>Defined By</th>
</tr>
                                                                                                                                                                                                                                                    <tr class="inherited" id="resolveFields()">
        <td><a href="yii-base-arrayabletrait.html#resolveFields()-detail">resolveFields()</a></td>
        <td>Determines which fields can be returned by <a href="yii-base-arrayabletrait.html#toArray()-detail">toArray()</a>.</td>
        <td><a href="yii-base-arrayabletrait.html">yii\base\ArrayableTrait</a></td>
    </tr>
                                        </table>
</div>

<a id="events"></a>
<div class="summary doc-event">
    <h2>Events</h2>

    <p><a href="#" class="toggle">Hide inherited events</a></p>

    <table class="summary-table table table-striped table-bordered table-hover">
    <colgroup>
        <col class="col-event" />
        <col class="col-type" />
        <col class="col-description" />
        <col class="col-defined" />
    </colgroup>
    <tr>
        <th>Event</th><th>Type</th><th>Description</th><th>Defined By</th>
    </tr>
        <tr id="EVENT_AFTER_VALIDATE">
        <td><a href="yii-base-model.html#EVENT_AFTER_VALIDATE-detail">EVENT_AFTER_VALIDATE</a></td>
        <td><a href="yii-base-event.html">yii\base\Event</a></td>
        <td>
            An event raised at the end of <a href="yii-base-model.html#validate()-detail">validate()</a>                    </td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
        <tr id="EVENT_BEFORE_VALIDATE">
        <td><a href="yii-base-model.html#EVENT_BEFORE_VALIDATE-detail">EVENT_BEFORE_VALIDATE</a></td>
        <td><a href="yii-base-modelevent.html">yii\base\ModelEvent</a></td>
        <td>
            An event raised at the beginning of <a href="yii-base-model.html#validate()-detail">validate()</a>.                    </td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
        </table>
</div>

<a id="constants"></a>
<div class="summary doc-const">
    <h2>Constants</h2>

    <p><a href="#" class="toggle">Hide inherited constants</a></p>

    <table class="summary-table table table-striped table-bordered table-hover">
    <colgroup>
        <col class="col-const" />
        <col class="col-value" />
        <col class="col-description" />
        <col class="col-defined" />
    </colgroup>
    <tr>
        <th>Constant</th><th>Value</th><th>Description</th><th>Defined By</th>
    </tr>
            <tr id="SCENARIO_DEFAULT">
          <td id="SCENARIO_DEFAULT-detail">SCENARIO_DEFAULT</td>
          <td>'default'</td>
          <td>The name of the default scenario.
</td>
          <td><a href="yii-base-model.html">yii\base\Model</a></td>
        </tr>
        </table>
</div>

<h2>Property Details</h2>

<div class="property-doc">

    <div class="detail-header h3" id="$activeValidators-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#$activeValidators-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $activeValidators        <span class="detail-header-tag small">
            public                         <em>read-only</em>                         property
                    </span>
    </div>

    <div class="doc-description">
        <p>The validators applicable to the current <a href="yii-base-model.html#$scenario-detail">$scenario</a>.</p>

            </div>

    <div class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-validators-validator.html">yii\validators\Validator</a>[]</span> <strong><a href="yii-base-model.html#getActiveValidators()-detail">getActiveValidators</a></strong> ( <span style="color: #0000BB">$attribute&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span> )</div>


    <div class="detail-header h3" id="$attributes-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#$attributes-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $attributes        <span class="detail-header-tag small">
            public                                                property
                    </span>
    </div>

    <div class="doc-description">
        <p>Attribute values (name =&gt; value).</p>

            </div>

    <div class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <strong><a href="yii-base-model.html#getAttributes()-detail">getAttributes</a></strong> ( <span style="color: #0000BB">$names&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span>, <span style="color: #0000BB">$except&nbsp;</span><span style="color: #007700">=&nbsp;[]</span> )<br /><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-base-model.html#setAttributes()-detail">setAttributes</a></strong> ( <span style="color: #0000BB">$values</span>, <span style="color: #0000BB">$safeOnly&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">true</span> )</div>


    <div class="detail-header h3" id="$errors-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#$errors-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $errors        <span class="detail-header-tag small">
            public                         <em>read-only</em>                         property
                    </span>
    </div>

    <div class="doc-description">
        <p>Errors for all attributes or the specified attribute. Empty array is returned if no error.
Note that when returning errors for all attributes, the result is a two-dimensional array, like the following:</p>
<pre><code class="hljs php language-php">[
    <span class="hljs-string">'username'</span> =&gt; [
        <span class="hljs-string">'Username is required.'</span>,
        <span class="hljs-string">'Username must contain only word characters.'</span>,
    ],
    <span class="hljs-string">'email'</span> =&gt; [
        <span class="hljs-string">'Email address is invalid.'</span>,
    ]
]
</code></pre>

            </div>

    <div class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <strong><a href="yii-base-model.html#getErrors()-detail">getErrors</a></strong> ( <span style="color: #0000BB">$attribute&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span> )</div>


    <div class="detail-header h3" id="$firstErrors-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#$firstErrors-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $firstErrors        <span class="detail-header-tag small">
            public                         <em>read-only</em>                         property
                    </span>
    </div>

    <div class="doc-description">
        <p>The first errors. The array keys are the attribute names, and the array
values are the corresponding error messages. An empty array will be returned if there is no error.</p>

            </div>

    <div class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <strong><a href="yii-base-model.html#getFirstErrors()-detail">getFirstErrors</a></strong> ( )</div>


    <div class="detail-header h3" id="$iterator-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#$iterator-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $iterator        <span class="detail-header-tag small">
            public                         <em>read-only</em>                         property
                    </span>
    </div>

    <div class="doc-description">
        <p>An iterator for traversing the items in the list.</p>

            </div>

    <div class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/class.arrayiterator">ArrayIterator</a></span> <strong><a href="yii-base-model.html#getIterator()-detail">getIterator</a></strong> ( )</div>


    <div class="detail-header h3" id="$scenario-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#$scenario-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $scenario        <span class="detail-header-tag small">
            public                                                property
                    </span>
    </div>

    <div class="doc-description">
        <p>The scenario that this model is in. Defaults to <a href="yii-base-model.html#SCENARIO_DEFAULT-detail">SCENARIO_DEFAULT</a>.</p>

            </div>

    <div class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.string">string</a></span> <strong><a href="yii-base-model.html#getScenario()-detail">getScenario</a></strong> ( )<br /><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-base-model.html#setScenario()-detail">setScenario</a></strong> ( <span style="color: #0000BB">$value</span> )</div>


    <div class="detail-header h3" id="$validators-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#$validators-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $validators        <span class="detail-header-tag small">
            public                         <em>read-only</em>                         property
                    </span>
    </div>

    <div class="doc-description">
        <p>All the validators declared in the model.</p>

            </div>

    <div class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/class.arrayobject">ArrayObject</a>|<a href="yii-validators-validator.html">yii\validators\Validator</a>[]</span> <strong><a href="yii-base-model.html#getValidators()-detail">getValidators</a></strong> ( )</div>

</div>
<h2>Method Details</h2>

<div class="method-doc">

    <div class="detail-header h3" id="activeAttributes()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#activeAttributes()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L769" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L769" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        activeAttributes()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the attribute names that are subject to validation in the current scenario.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.string">string</a>[]</span> <strong><a href="yii-base-model.html#activeAttributes()-detail">activeAttributes</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a>[]</td>
                  <td class="param-desc-col"><p>Safe attribute names</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="addError()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#addError()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L608" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L608" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        addError()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Adds a new error to the specified attribute.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-base-model.html#addError()-detail">addError</a></strong> ( <span style="color: #0000BB">$attribute</span>, <span style="color: #0000BB">$error&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">''</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$attribute</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>Attribute name</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$error</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>New error message</p>
</td>
                </tr>
                                                </table>

<!--	-->

    <div class="detail-header h3" id="addErrors()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#addErrors()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L621" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L621" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        addErrors()
        <span class="detail-header-tag small">
            public                                    method
                            (available since version 2.0.2)
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Adds a list of errors.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-base-model.html#addErrors()-detail">addErrors</a></strong> ( <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <span style="color: #0000BB">$items</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$items</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>A list of errors. The array keys must be attribute names.
The array values should be error messages. If an attribute has multiple errors,
these errors must be given in terms of an array.
You may use the result of <a href="yii-base-model.html#getErrors()-detail">getErrors()</a> as the value for this parameter.</p>
</td>
                </tr>
                                                </table>

<!--	-->

    <div class="detail-header h3" id="afterValidate()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#afterValidate()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L385" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L385" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        afterValidate()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>This method is invoked after validation ends.</strong></p>

        <p>The default implementation raises an <code>afterValidate</code> event.
You may override this method to do postprocessing after validation.
Make sure the parent implementation is invoked so that the event can be raised.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-base-model.html#afterValidate()-detail">afterValidate</a></strong> ( )</td></tr>
            </table>

<!--	-->

    <div class="detail-header h3" id="attributeHints()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#attributeHints()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L307" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L307" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        attributeHints()
        <span class="detail-header-tag small">
            public                                    method
                            (available since version 2.0.4)
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the attribute hints.</strong></p>

        <p>Attribute hints are mainly used for display purpose. For example, given an attribute
<code>isPublic</code>, we can declare a hint <code>Whether the post should be visible for not logged in users</code>,
which provides user-friendly description of the attribute meaning and can be displayed to end users.</p>
<p>Unlike label hint will not be generated, if its explicit declaration is omitted.</p>
<p>Note, in order to inherit hints defined in the parent class, a child class needs to
merge the parent hints with child hints using functions such as <code>array_merge()</code>.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <strong><a href="yii-base-model.html#attributeHints()-detail">attributeHints</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Attribute hints (name =&gt; hint)</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="attributeLabels()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#attributeLabels()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L287" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L287" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        attributeLabels()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the attribute labels.</strong></p>

        <p>Attribute labels are mainly used for display purpose. For example, given an attribute
<code>firstName</code>, we can declare a label <code>First Name</code> which is more user-friendly and can
be displayed to end users.</p>
<p>By default an attribute label is generated using <a href="yii-base-model.html#generateAttributeLabel()-detail">generateAttributeLabel()</a>.
This method allows you to explicitly specify attribute labels.</p>
<p>Note, in order to inherit labels defined in the parent class, a child class needs to
merge the parent labels with child labels using functions such as <code>array_merge()</code>.</p>

        <p>See also <a href="yii-base-model.html#generateAttributeLabel()-detail">generateAttributeLabel()</a>.</p>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <strong><a href="yii-base-model.html#attributeLabels()-detail">attributeLabels</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Attribute labels (name =&gt; label)</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="attributes()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#attributes()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L258" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L258" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        attributes()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the list of attribute names.</strong></p>

        <p>By default, this method returns all public non-static properties of the class.
You may override this method to change the default behavior.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <strong><a href="yii-base-model.html#attributes()-detail">attributes</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>List of attribute names.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="beforeValidate()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#beforeValidate()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L371" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L371" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        beforeValidate()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>This method is invoked before validation starts.</strong></p>

        <p>The default implementation raises a <code>beforeValidate</code> event.
You may override this method to do preliminary checks before validation.
Make sure the parent implementation is invoked so that the event can be raised.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-base-model.html#beforeValidate()-detail">beforeValidate</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether the validation should be executed. Defaults to true.
If false is returned, the validation will stop and the model is considered invalid.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="clearErrors()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#clearErrors()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L638" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L638" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        clearErrors()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Removes errors for all attributes or a single attribute.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-base-model.html#clearErrors()-detail">clearErrors</a></strong> ( <span style="color: #0000BB">$attribute&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$attribute</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>Attribute name. Use null to remove errors for all attribute.</p>
</td>
                </tr>
                                                </table>

<!--	-->

    <div class="detail-header h3" id="createValidators()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#createValidators()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L438" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L438" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        createValidators()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Creates validator objects based on the validation rules specified in <a href="yii-base-model.html#rules()-detail">rules()</a>.</strong></p>

        <p>Unlike <a href="yii-base-model.html#getValidators()-detail">getValidators()</a>, each time this method is called, a new list of validators will be returned.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/class.arrayobject">ArrayObject</a></span> <strong><a href="yii-base-model.html#createValidators()-detail">createValidators</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/class.arrayobject">ArrayObject</a></td>
                  <td class="param-desc-col"><p>Validators</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-base-invalidconfigexception.html">yii\base\InvalidConfigException</a></td>
                  <td class="param-desc-col"><p>if any validation rule configuration is invalid</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="fields()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#fields()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L945" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L945" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        fields()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the list of fields that should be returned by default by <a href="yii-base-arrayabletrait.html#toArray()-detail">toArray()</a> when no specific fields are specified.</strong></p>

        <p>A field is a named element in the returned array by <a href="yii-base-arrayabletrait.html#toArray()-detail">toArray()</a>.</p>
<p>This method should return an array of field names or field definitions.
If the former, the field name will be treated as an object property name whose value will be used
as the field value. If the latter, the array key should be the field name while the array value should be
the corresponding field definition which can be either an object property name or a PHP callable
returning the corresponding field value. The signature of the callable should be:</p>
<pre><code class="hljs php language-php"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-params">(<span class="hljs-variable">$model</span>, <span class="hljs-variable">$field</span>)</span> </span>{
    <span class="hljs-comment">// return field value</span>
}
</code></pre>
<p>For example, the following code declares four fields:</p>
<ul>
<li><code>email</code>: the field name is the same as the property name <code>email</code>;</li>
<li><code>firstName</code> and <code>lastName</code>: the field names are <code>firstName</code> and <code>lastName</code>, and their
values are obtained from the <code>first_name</code> and <code>last_name</code> properties;</li>
<li><code>fullName</code>: the field name is <code>fullName</code>. Its value is obtained by concatenating <code>first_name</code>
and <code>last_name</code>.</li>
</ul>
<pre><code class="hljs php language-php"><span class="hljs-keyword">return</span> [
    <span class="hljs-string">'email'</span>,
    <span class="hljs-string">'firstName'</span> =&gt; <span class="hljs-string">'first_name'</span>,
    <span class="hljs-string">'lastName'</span> =&gt; <span class="hljs-string">'last_name'</span>,
    <span class="hljs-string">'fullName'</span> =&gt; <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-params">(<span class="hljs-variable">$model</span>)</span> </span>{
        <span class="hljs-keyword">return</span> <span class="hljs-variable">$model</span>-&gt;first_name . <span class="hljs-string">' '</span> . <span class="hljs-variable">$model</span>-&gt;last_name;
    },
];
</code></pre>
<p>In this method, you may also want to return different lists of fields based on some context
information. For example, depending on <a href="yii-base-model.html#$scenario-detail">$scenario</a> or the privilege of the current application user,
you may return different sets of visible fields or filter out some fields.</p>
<p>The default implementation of this method returns <a href="yii-base-model.html#attributes()-detail">attributes()</a> indexed by the same attribute names.</p>

        <p>See also <a href="yii-base-arrayabletrait.html#toArray()-detail">toArray()</a>.</p>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <strong><a href="yii-base-model.html#fields()-detail">fields</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The list of field names or field definitions.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="formName()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#formName()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L246" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L246" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        formName()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the form name that this model class should use.</strong></p>

        <p>The form name is mainly used by <a href="yii-widgets-activeform.html">yii\widgets\ActiveForm</a> to determine how to name
the input fields for the attributes in a model. If the form name is "A" and an attribute
name is "b", then the corresponding input name would be "A[b]". If the form name is
an empty string, then the input name would be "b".</p>
<p>The purpose of the above naming schema is that for forms which contain multiple different models,
the attributes of each model are grouped in sub-arrays of the POST-data and it is easier to
differentiate between them.</p>
<p>By default, this method returns the model class name (without the namespace part)
as the form name. You may override it when the model is used in different forms.</p>

        <p>See also <a href="yii-base-model.html#load()-detail">load()</a>.</p>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.string">string</a></span> <strong><a href="yii-base-model.html#formName()-detail">formName</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The form name of this model class.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="generateAttributeLabel()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#generateAttributeLabel()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L655" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L655" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        generateAttributeLabel()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Generates a user friendly attribute label based on the give attribute name.</strong></p>

        <p>This is done by replacing underscores, dashes and dots with blanks and
changing the first letter of each word to upper case.
For example, 'department_name' or 'DepartmentName' will generate 'Department Name'.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.string">string</a></span> <strong><a href="yii-base-model.html#generateAttributeLabel()-detail">generateAttributeLabel</a></strong> ( <span style="color: #0000BB">$name</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$name</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The column name</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The attribute label</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="getActiveValidators()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#getActiveValidators()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L420" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L420" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getActiveValidators()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the validators applicable to the current <a href="yii-base-model.html#$scenario-detail">$scenario</a>.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-validators-validator.html">yii\validators\Validator</a>[]</span> <strong><a href="yii-base-model.html#getActiveValidators()-detail">getActiveValidators</a></strong> ( <span style="color: #0000BB">$attribute&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$attribute</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The name of the attribute whose applicable validators should be returned.
If this is null, the validators for ALL attributes in the model will be returned.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-validators-validator.html">yii\validators\Validator</a>[]</td>
                  <td class="param-desc-col"><p>The validators applicable to the current <a href="yii-base-model.html#$scenario-detail">$scenario</a>.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="getAttributeHint()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#getAttributeHint()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L520" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L520" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getAttributeHint()
        <span class="detail-header-tag small">
            public                                    method
                            (available since version 2.0.4)
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the text hint for the specified attribute.</strong></p>

        
        <p>See also <a href="yii-base-model.html#attributeHints()-detail">attributeHints()</a>.</p>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.string">string</a></span> <strong><a href="yii-base-model.html#getAttributeHint()-detail">getAttributeHint</a></strong> ( <span style="color: #0000BB">$attribute</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$attribute</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The attribute name</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The attribute hint</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="getAttributeLabel()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#getAttributeLabel()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L507" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L507" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getAttributeLabel()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the text label for the specified attribute.</strong></p>

        
        <p>See also:</p><ul><li><a href="yii-base-model.html#generateAttributeLabel()-detail">generateAttributeLabel()</a></li><li><a href="yii-base-model.html#attributeLabels()-detail">attributeLabels()</a></li></ul>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.string">string</a></span> <strong><a href="yii-base-model.html#getAttributeLabel()-detail">getAttributeLabel</a></strong> ( <span style="color: #0000BB">$attribute</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$attribute</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The attribute name</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The attribute label</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="getAttributes()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#getAttributes()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L668" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L668" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getAttributes()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns attribute values.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <strong><a href="yii-base-model.html#getAttributes()-detail">getAttributes</a></strong> ( <span style="color: #0000BB">$names&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span>, <span style="color: #0000BB">$except&nbsp;</span><span style="color: #007700">=&nbsp;[]</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$names</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>List of attributes whose value needs to be returned.
Defaults to null, meaning all attributes listed in <a href="yii-base-model.html#attributes()-detail">attributes()</a> will be returned.
If it is an array, only the attributes in the array will be returned.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$except</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>List of attributes whose value should NOT be returned.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Attribute values (name =&gt; value).</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="getErrors()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#getErrors()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L559" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L559" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getErrors()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the errors for all attribute or a single attribute.</strong></p>

        
        <p>See also:</p><ul><li><a href="yii-base-model.html#getFirstErrors()-detail">getFirstErrors()</a></li><li><a href="yii-base-model.html#getFirstError()-detail">getFirstError()</a></li></ul>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <strong><a href="yii-base-model.html#getErrors()-detail">getErrors</a></strong> ( <span style="color: #0000BB">$attribute&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$attribute</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>Attribute name. Use null to retrieve errors for all attributes.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Errors for all attributes or the specified attribute. Empty array is returned if no error.
Note that when returning errors for all attributes, the result is a two-dimensional array, like the following:</p>
<pre><code class="hljs php language-php">[
    <span class="hljs-string">'username'</span> =&gt; [
        <span class="hljs-string">'Username is required.'</span>,
        <span class="hljs-string">'Username must contain only word characters.'</span>,
    ],
    <span class="hljs-string">'email'</span> =&gt; [
        <span class="hljs-string">'Email address is invalid.'</span>,
    ]
]
</code></pre>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="getFirstError()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#getFirstError()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L598" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L598" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getFirstError()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the first error of the specified attribute.</strong></p>

        
        <p>See also:</p><ul><li><a href="yii-base-model.html#getErrors()-detail">getErrors()</a></li><li><a href="yii-base-model.html#getFirstErrors()-detail">getFirstErrors()</a></li></ul>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.string">string</a></span> <strong><a href="yii-base-model.html#getFirstError()-detail">getFirstError</a></strong> ( <span style="color: #0000BB">$attribute</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$attribute</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>Attribute name.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The error message. Null is returned if no error.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="getFirstErrors()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#getFirstErrors()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L575" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L575" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getFirstErrors()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the first error of every attribute in the model.</strong></p>

        
        <p>See also:</p><ul><li><a href="yii-base-model.html#getErrors()-detail">getErrors()</a></li><li><a href="yii-base-model.html#getFirstError()-detail">getFirstError()</a></li></ul>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <strong><a href="yii-base-model.html#getFirstErrors()-detail">getFirstErrors</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The first errors. The array keys are the attribute names, and the array
values are the corresponding error messages. An empty array will be returned if there is no error.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="getIterator()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#getIterator()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L957" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L957" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getIterator()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns an iterator for traversing the attributes in the model.</strong></p>

        <p>This method is required by the interface <a href="http://www.php.net/class.iteratoraggregate">IteratorAggregate</a>.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/class.arrayiterator">ArrayIterator</a></span> <strong><a href="yii-base-model.html#getIterator()-detail">getIterator</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/class.arrayiterator">ArrayIterator</a></td>
                  <td class="param-desc-col"><p>An iterator for traversing the items in the list.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="getScenario()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#getScenario()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L728" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L728" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getScenario()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the scenario that this model is used in.</strong></p>

        <p>Scenario affects how validation is performed and which attributes can
be massively assigned.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.string">string</a></span> <strong><a href="yii-base-model.html#getScenario()-detail">getScenario</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The scenario that this model is in. Defaults to <a href="yii-base-model.html#SCENARIO_DEFAULT-detail">SCENARIO_DEFAULT</a>.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="getValidators()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#getValidators()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L406" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L406" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getValidators()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns all the validators declared in <a href="yii-base-model.html#rules()-detail">rules()</a>.</strong></p>

        <p>This method differs from <a href="yii-base-model.html#getActiveValidators()-detail">getActiveValidators()</a> in that the latter
only returns the validators applicable to the current <a href="yii-base-model.html#$scenario-detail">$scenario</a>.</p>
<p>Because this method returns an ArrayObject object, you may
manipulate it by inserting or removing validators (useful in model behaviors).
For example,</p>
<pre><code class="hljs php language-php"><span class="hljs-variable">$model</span>-&gt;validators[] = <span class="hljs-variable">$newValidator</span>;
</code></pre>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/class.arrayobject">ArrayObject</a>|<a href="yii-validators-validator.html">yii\validators\Validator</a>[]</span> <strong><a href="yii-base-model.html#getValidators()-detail">getValidators</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/class.arrayobject">ArrayObject</a>|<a href="yii-validators-validator.html">yii\validators\Validator</a>[]</td>
                  <td class="param-desc-col"><p>All the validators declared in the model.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="hasErrors()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#hasErrors()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L531" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L531" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        hasErrors()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns a value indicating whether there is any validation error.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-base-model.html#hasErrors()-detail">hasErrors</a></strong> ( <span style="color: #0000BB">$attribute&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$attribute</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a>|<a href="http://www.php.net/language.types.null">null</a></td>
                  <td class="param-desc-col"><p>Attribute name. Use null to check all attributes.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether there is any error.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="isAttributeActive()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#isAttributeActive()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L495" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L495" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        isAttributeActive()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns a value indicating whether the attribute is active in the current scenario.</strong></p>

        
        <p>See also <a href="yii-base-model.html#activeAttributes()-detail">activeAttributes()</a>.</p>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-base-model.html#isAttributeActive()-detail">isAttributeActive</a></strong> ( <span style="color: #0000BB">$attribute</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$attribute</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>Attribute name</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether the attribute is active in the current scenario</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="isAttributeRequired()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#isAttributeRequired()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L468" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L468" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        isAttributeRequired()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns a value indicating whether the attribute is required.</strong></p>

        <p>This is determined by checking if the attribute is associated with a
<a href="yii-validators-requiredvalidator.html">required</a> validation rule in the
current <a href="yii-base-model.html#$scenario-detail">$scenario</a>.</p>
<p>Note that when the validator has a conditional validation applied using
<a href="yii-validators-validator.html#$when-detail">$when</a> this method will return
<code>false</code> regardless of the <code>when</code> condition because it may be called be
before the model is loaded with data.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-base-model.html#isAttributeRequired()-detail">isAttributeRequired</a></strong> ( <span style="color: #0000BB">$attribute</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$attribute</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>Attribute name</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether the attribute is required</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="isAttributeSafe()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#isAttributeSafe()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L484" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L484" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        isAttributeSafe()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns a value indicating whether the attribute is safe for massive assignments.</strong></p>

        
        <p>See also <a href="yii-base-model.html#safeAttributes()-detail">safeAttributes()</a>.</p>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-base-model.html#isAttributeSafe()-detail">isAttributeSafe</a></strong> ( <span style="color: #0000BB">$attribute</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$attribute</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>Attribute name</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether the attribute is safe for massive assignments</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="load()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#load()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L819" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L819" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        load()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Populates the model with input data.</strong></p>

        <p>This method provides a convenient shortcut for:</p>
<pre><code class="hljs php language-php"><span class="hljs-keyword">if</span> (<span class="hljs-keyword">isset</span>(<span class="hljs-variable">$_POST</span>[<span class="hljs-string">'FormName'</span>])) {
    <span class="hljs-variable">$model</span>-&gt;attributes = <span class="hljs-variable">$_POST</span>[<span class="hljs-string">'FormName'</span>];
    <span class="hljs-keyword">if</span> (<span class="hljs-variable">$model</span>-&gt;save()) {
        <span class="hljs-comment">// handle success</span>
    }
}
</code></pre>
<p>which, with <code>load()</code> can be written as:</p>
<pre><code class="hljs php language-php"><span class="hljs-keyword">if</span> (<span class="hljs-variable">$model</span>-&gt;load(<span class="hljs-variable">$_POST</span>) &amp;&amp; <span class="hljs-variable">$model</span>-&gt;save()) {
    <span class="hljs-comment">// handle success</span>
}
</code></pre>
<p><code>load()</code> gets the <code>'FormName'</code> from the model's <a href="yii-base-model.html#formName()-detail">formName()</a> method (which you may override), unless the
<code>$formName</code> parameter is given. If the form name is empty, <code>load()</code> populates the model with the whole of <code>$data</code>,
instead of <code>$data['FormName']</code>.</p>
<p>Note, that the data being populated is subject to the safety check by <a href="yii-base-model.html#setAttributes()-detail">setAttributes()</a>.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-base-model.html#load()-detail">load</a></strong> ( <span style="color: #0000BB">$data</span>, <span style="color: #0000BB">$formName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$data</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The data array to load, typically <code>$_POST</code> or <code>$_GET</code>.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$formName</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The form name to use to load the data into the model.
If not set, <a href="yii-base-model.html#formName()-detail">formName()</a> is used.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether <code>load()</code> found the expected form in <code>$data</code>.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="loadMultiple()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#loadMultiple()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L850" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L850" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        loadMultiple()
        <span class="detail-header-tag small">
            public                        static            method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Populates a set of models with the data from end user.</strong></p>

        <p>This method is mainly used to collect tabular data input.
The data to be loaded for each model is <code>$data[formName][index]</code>, where <code>formName</code>
refers to the value of <a href="yii-base-model.html#formName()-detail">formName()</a>, and <code>index</code> the index of the model in the <code>$models</code> array.
If <a href="yii-base-model.html#formName()-detail">formName()</a> is empty, <code>$data[index]</code> will be used to populate each model.
The data being populated to each model is subject to the safety check by <a href="yii-base-model.html#setAttributes()-detail">setAttributes()</a>.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public static</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-base-model.html#loadMultiple()-detail">loadMultiple</a></strong> ( <span style="color: #0000BB">$models</span>, <span style="color: #0000BB">$data</span>, <span style="color: #0000BB">$formName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$models</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The models to be populated. Note that all models should have the same class.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$data</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The data array. This is usually <code>$_POST</code> or <code>$_GET</code>, but can also be any valid array
supplied by end user.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$formName</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The form name to be used for loading the data into the models.
If not set, it will use the <a href="yii-base-model.html#formName()-detail">formName()</a> value of the first model in <code>$models</code>.
This parameter is available since version 2.0.1.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether at least one of the models is successfully populated.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="offsetExists()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#offsetExists()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L970" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L970" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        offsetExists()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns whether there is an element at the specified offset.</strong></p>

        <p>This method is required by the SPL interface <a href="http://www.php.net/class.arrayaccess">ArrayAccess</a>.
It is implicitly called when you use something like <code>isset($model[$offset])</code>.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-base-model.html#offsetExists()-detail">offsetExists</a></strong> ( <span style="color: #0000BB">$offset</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$offset</span></td>
                  <td class="param-type-col">mixed</td>
                  <td class="param-desc-col"><p>The offset to check on</p>
</td>
                </tr>
                                                </table>

<!--	-->

    <div class="detail-header h3" id="offsetGet()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#offsetGet()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L982" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L982" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        offsetGet()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the element at the specified offset.</strong></p>

        <p>This method is required by the SPL interface <a href="http://www.php.net/class.arrayaccess">ArrayAccess</a>.
It is implicitly called when you use something like <code>$value = $model[$offset];</code>.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">mixed</span> <strong><a href="yii-base-model.html#offsetGet()-detail">offsetGet</a></strong> ( <span style="color: #0000BB">$offset</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$offset</span></td>
                  <td class="param-type-col">mixed</td>
                  <td class="param-desc-col"><p>The offset to retrieve element.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col">mixed</td>
                  <td class="param-desc-col"><p>The element at the offset, null if no element is found at the offset</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="offsetSet()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#offsetSet()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L994" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L994" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        offsetSet()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Sets the element at the specified offset.</strong></p>

        <p>This method is required by the SPL interface <a href="http://www.php.net/class.arrayaccess">ArrayAccess</a>.
It is implicitly called when you use something like <code>$model[$offset] = $item;</code>.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-base-model.html#offsetSet()-detail">offsetSet</a></strong> ( <span style="color: #0000BB">$offset</span>, <span style="color: #0000BB">$item</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$offset</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.integer">integer</a></td>
                  <td class="param-desc-col"><p>The offset to set element</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$item</span></td>
                  <td class="param-type-col">mixed</td>
                  <td class="param-desc-col"><p>The element value</p>
</td>
                </tr>
                                                </table>

<!--	-->

    <div class="detail-header h3" id="offsetUnset()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#offsetUnset()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L1005" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L1005" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        offsetUnset()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Sets the element value at the specified offset to null.</strong></p>

        <p>This method is required by the SPL interface <a href="http://www.php.net/class.arrayaccess">ArrayAccess</a>.
It is implicitly called when you use something like <code>unset($model[$offset])</code>.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-base-model.html#offsetUnset()-detail">offsetUnset</a></strong> ( <span style="color: #0000BB">$offset</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$offset</span></td>
                  <td class="param-type-col">mixed</td>
                  <td class="param-desc-col"><p>The offset to unset element</p>
</td>
                </tr>
                                                </table>

<!--	-->

    <div class="detail-header h3" id="onUnsafeAttribute()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#onUnsafeAttribute()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L713" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L713" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        onUnsafeAttribute()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>This method is invoked when an unsafe attribute is being massively assigned.</strong></p>

        <p>The default implementation will log a warning message if YII_DEBUG is on.
It does nothing otherwise.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-base-model.html#onUnsafeAttribute()-detail">onUnsafeAttribute</a></strong> ( <span style="color: #0000BB">$name</span>, <span style="color: #0000BB">$value</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$name</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The unsafe attribute name</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$value</span></td>
                  <td class="param-type-col">mixed</td>
                  <td class="param-desc-col"><p>The attribute value</p>
</td>
                </tr>
                                                </table>

<!--	-->

    <div class="detail-header h3" id="rules()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#rules()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L153" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L153" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        rules()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the validation rules for attributes.</strong></p>

        <p>Validation rules are used by <a href="yii-base-model.html#validate()-detail">validate()</a> to check if attribute values are valid.
Child classes may override this method to declare different validation rules.</p>
<p>Each rule is an array with the following structure:</p>
<pre><code class="hljs php language-php">[
    [<span class="hljs-string">'attribute1'</span>, <span class="hljs-string">'attribute2'</span>],
    <span class="hljs-string">'validator type'</span>,
    <span class="hljs-string">'on'</span> =&gt; [<span class="hljs-string">'scenario1'</span>, <span class="hljs-string">'scenario2'</span>],
    <span class="hljs-comment">//...other parameters...</span>
]
</code></pre>
<p>where</p>
<ul>
<li>attribute list: required, specifies the attributes array to be validated, for single attribute you can pass a string;</li>
<li>validator type: required, specifies the validator to be used. It can be a built-in validator name,
a method name of the model class, an anonymous function, or a validator class name.</li>
<li>on: optional, specifies the <a href="yii-base-model.html#$scenario-detail">scenarios</a> array in which the validation
rule can be applied. If this option is not set, the rule will apply to all scenarios.</li>
<li>additional name-value pairs can be specified to initialize the corresponding validator properties.
Please refer to individual validator class API for possible properties.</li>
</ul>
<p>A validator can be either an object of a class extending <a href="yii-validators-validator.html">yii\validators\Validator</a>, or a model class method
(called <em>inline validator</em>) that has the following signature:</p>
<pre><code class="hljs php language-php"><span class="hljs-comment">// $params refers to validation parameters given in the rule</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">validatorName</span><span class="hljs-params">(<span class="hljs-variable">$attribute</span>, <span class="hljs-variable">$params</span>)</span>
</span></code></pre>
<p>In the above <code>$attribute</code> refers to the attribute currently being validated while <code>$params</code> contains an array of
validator configuration options such as <code>max</code> in case of <code>string</code> validator. The value of the attribute currently being validated
can be accessed as <code>$this-&gt;$attribute</code>. Note the <code>$</code> before <code>attribute</code>; this is taking the value of the variable
<code>$attribute</code> and using it as the name of the property to access.</p>
<p>Yii also provides a set of <a href="yii-validators-validator.html#$builtInValidators-detail">built-in validators</a>.
Each one has an alias name which can be used when specifying a validation rule.</p>
<p>Below are some examples:</p>
<pre><code class="hljs php language-php">[
    <span class="hljs-comment">// built-in "required" validator</span>
    [[<span class="hljs-string">'username'</span>, <span class="hljs-string">'password'</span>], <span class="hljs-string">'required'</span>],
    <span class="hljs-comment">// built-in "string" validator customized with "min" and "max" properties</span>
    [<span class="hljs-string">'username'</span>, <span class="hljs-string">'string'</span>, <span class="hljs-string">'min'</span> =&gt; <span class="hljs-number">3</span>, <span class="hljs-string">'max'</span> =&gt; <span class="hljs-number">12</span>],
    <span class="hljs-comment">// built-in "compare" validator that is used in "register" scenario only</span>
    [<span class="hljs-string">'password'</span>, <span class="hljs-string">'compare'</span>, <span class="hljs-string">'compareAttribute'</span> =&gt; <span class="hljs-string">'password2'</span>, <span class="hljs-string">'on'</span> =&gt; <span class="hljs-string">'register'</span>],
    <span class="hljs-comment">// an inline validator defined via the "authenticate()" method in the model class</span>
    [<span class="hljs-string">'password'</span>, <span class="hljs-string">'authenticate'</span>, <span class="hljs-string">'on'</span> =&gt; <span class="hljs-string">'login'</span>],
    <span class="hljs-comment">// a validator of class "DateRangeValidator"</span>
    [<span class="hljs-string">'dateRange'</span>, <span class="hljs-string">'DateRangeValidator'</span>],
];
</code></pre>
<p>Note, in order to inherit rules defined in the parent class, a child class needs to
merge the parent rules with child rules using functions such as <code>array_merge()</code>.</p>

        <p>See also <a href="yii-base-model.html#scenarios()-detail">scenarios()</a>.</p>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <strong><a href="yii-base-model.html#rules()-detail">rules</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Validation rules</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="safeAttributes()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#safeAttributes()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L748" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L748" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        safeAttributes()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the attribute names that are safe to be massively assigned in the current scenario.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.string">string</a>[]</span> <strong><a href="yii-base-model.html#safeAttributes()-detail">safeAttributes</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a>[]</td>
                  <td class="param-desc-col"><p>Safe attribute names</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="scenarios()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#scenarios()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L182" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L182" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        scenarios()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns a list of scenarios and the corresponding active attributes.</strong></p>

        <p>An active attribute is one that is subject to validation in the current scenario.
The returned array should be in the following format:</p>
<pre><code class="hljs php language-php">[
    <span class="hljs-string">'scenario1'</span> =&gt; [<span class="hljs-string">'attribute11'</span>, <span class="hljs-string">'attribute12'</span>, ...],
    <span class="hljs-string">'scenario2'</span> =&gt; [<span class="hljs-string">'attribute21'</span>, <span class="hljs-string">'attribute22'</span>, ...],
    ...
]
</code></pre>
<p>By default, an active attribute is considered safe and can be massively assigned.
If an attribute should NOT be massively assigned (thus considered unsafe),
please prefix the attribute with an exclamation character (e.g. <code>'!rank'</code>).</p>
<p>The default implementation of this method will return all scenarios found in the <a href="yii-base-model.html#rules()-detail">rules()</a>
declaration. A special scenario named <a href="yii-base-model.html#SCENARIO_DEFAULT-detail">SCENARIO_DEFAULT</a> will contain all attributes
found in the <a href="yii-base-model.html#rules()-detail">rules()</a>. Each scenario will be associated with the attributes that
are being validated by the validation rules that apply to the scenario.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <strong><a href="yii-base-model.html#scenarios()-detail">scenarios</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>A list of scenarios and the corresponding active attributes.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="setAttributes()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#setAttributes()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L692" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L692" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        setAttributes()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Sets the attribute values in a massive way.</strong></p>

        
        <p>See also:</p><ul><li><a href="yii-base-model.html#safeAttributes()-detail">safeAttributes()</a></li><li><a href="yii-base-model.html#attributes()-detail">attributes()</a></li></ul>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-base-model.html#setAttributes()-detail">setAttributes</a></strong> ( <span style="color: #0000BB">$values</span>, <span style="color: #0000BB">$safeOnly&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">true</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$values</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Attribute values (name =&gt; value) to be assigned to the model.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$safeOnly</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether the assignments should only be done to the safe attributes.
A safe attribute is one that is associated with a validation rule in the current <a href="yii-base-model.html#$scenario-detail">$scenario</a>.</p>
</td>
                </tr>
                                                </table>

<!--	-->

    <div class="detail-header h3" id="setScenario()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#setScenario()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L739" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L739" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        setScenario()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Sets the scenario for the model.</strong></p>

        <p>Note that this method does not check if the scenario exists or not.
The method <a href="yii-base-model.html#validate()-detail">validate()</a> will perform this check.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-base-model.html#setScenario()-detail">setScenario</a></strong> ( <span style="color: #0000BB">$value</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$value</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The scenario that this model is in.</p>
</td>
                </tr>
                                                </table>

<!--	-->

    <div class="detail-header h3" id="validate()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#validate()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L335" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L335" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        validate()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Performs the data validation.</strong></p>

        <p>This method executes the validation rules applicable to the current <a href="yii-base-model.html#$scenario-detail">$scenario</a>.
The following criteria are used to determine whether a rule is currently applicable:</p>
<ul>
<li>the rule must be associated with the attributes relevant to the current scenario;</li>
<li>the rules must be effective for the current scenario.</li>
</ul>
<p>This method will call <a href="yii-base-model.html#beforeValidate()-detail">beforeValidate()</a> and <a href="yii-base-model.html#afterValidate()-detail">afterValidate()</a> before and
after the actual validation, respectively. If <a href="yii-base-model.html#beforeValidate()-detail">beforeValidate()</a> returns false,
the validation will be cancelled and <a href="yii-base-model.html#afterValidate()-detail">afterValidate()</a> will not be called.</p>
<p>Errors found during the validation can be retrieved via <a href="yii-base-model.html#getErrors()-detail">getErrors()</a>,
<a href="yii-base-model.html#getFirstErrors()-detail">getFirstErrors()</a> and <a href="yii-base-model.html#getFirstError()-detail">getFirstError()</a>.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-base-model.html#validate()-detail">validate</a></strong> ( <span style="color: #0000BB">$attributeNames&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span>, <span style="color: #0000BB">$clearErrors&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">true</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$attributeNames</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>List of attribute names that should be validated.
If this parameter is empty, it means any attribute listed in the applicable
validation rules should be validated.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$clearErrors</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether to call <a href="yii-base-model.html#clearErrors()-detail">clearErrors()</a> before performing validation</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether the validation is successful without any error.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-base-invalidparamexception.html">yii\base\InvalidParamException</a></td>
                  <td class="param-desc-col"><p>if the current scenario is unknown.</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="validateMultiple()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#validateMultiple()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L889" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L889" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        validateMultiple()
        <span class="detail-header-tag small">
            public                        static            method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Validates multiple models.</strong></p>

        <p>This method will validate every model. The models being validated may
be of the same or different types.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public static</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-base-model.html#validateMultiple()-detail">validateMultiple</a></strong> ( <span style="color: #0000BB">$models</span>, <span style="color: #0000BB">$attributeNames&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$models</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The models to be validated</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$attributeNames</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>List of attribute names that should be validated.
If this parameter is empty, it means any attribute listed in the applicable
validation rules should be validated.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether all models are valid. False will be returned if one
or multiple models have validation error.</p>
</td>
                </tr>
                                    </table>

<!--	-->
</div>
    <h2>Event Details</h2>

<div class="event-doc">
    <div class="detail-header h3" id="EVENT_AFTER_VALIDATE-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#EVENT_AFTER_VALIDATE-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L71" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L71" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        EVENT_AFTER_VALIDATE        <span class="detail-header-tag small">
        event
        of type <a href="yii-base-event.html">yii\base\Event</a>                </span>
    </div>

    <div class="doc-description">
        <p>An event raised at the end of <a href="yii-base-model.html#validate()-detail">validate()</a></p>

            </div>

    <div class="detail-header h3" id="EVENT_BEFORE_VALIDATE-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-base-model.html#EVENT_BEFORE_VALIDATE-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/base/Model.php#L67" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/base/Model.php#L67" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        EVENT_BEFORE_VALIDATE        <span class="detail-header-tag small">
        event
        of type <a href="yii-base-modelevent.html">yii\base\ModelEvent</a>                </span>
    </div>

    <div class="doc-description">
        <p>An event raised at the beginning of <a href="yii-base-model.html#validate()-detail">validate()</a>. You may set
<a href="yii-base-modelevent.html#$isValid-detail">yii\base\ModelEvent::$isValid</a> to be false to stop the validation.</p>

            </div>

</div>
    </div>
</div>

<script type="text/javascript">
    /*<![CDATA[*/
    $("a.toggle").on('click', function () {
        var $this = $(this);
        if ($this.hasClass('properties-hidden')) {
            $this.text($this.text().replace(/Show/,'Hide'));
            $this.parents(".summary").find(".inherited").show();
            $this.removeClass('properties-hidden');
        } else {
            $this.text($this.text().replace(/Hide/,'Show'));
            $this.parents(".summary").find(".inherited").hide();
            $this.addClass('properties-hidden');
        }

        return false;
    });
    /*
     $(".sourceCode a.show").toggle(function () {
     $(this).text($(this).text().replace(/show/,'hide'));
     $(this).parents(".sourceCode").find("div.code").show();
     },function () {
     $(this).text($(this).text().replace(/hide/,'show'));
     $(this).parents(".sourceCode").find("div.code").hide();
     });
     $("a.sourceLink").click(function () {
     $(this).attr('target','_blank');
     });
     */
    /*]]>*/
</script>


</div>

<footer class="footer">
        <p class="pull-right"><small>Page generated on Sat, 09 Jul 2016 12:15:38 +0000</small></p>
    Powered by <a href="http://www.yiiframework.com/" rel="external">Yii Framework</a></footer>

<script type="text/javascript">jQuery(document).ready(function () {
    var shiftWindow = function () { scrollBy(0, -50) };
    if (location.hash) setTimeout(shiftWindow, 1);
    window.addEventListener("hashchange", shiftWindow);
var element = document.createElement("script");
element.src = "./jssearch.index.js";
document.body.appendChild(element);

var searchBox = $('#searchbox');

// search when typing in search field
searchBox.on("keyup", function(event) {
    var query = $(this).val();

    if (query == '' || event.which == 27) {
        $('#search-resultbox').hide();
        return;
    } else if (event.which == 13) {
        var selectedLink = $('#search-resultbox a.selected');
        if (selectedLink.length != 0) {
            document.location = selectedLink.attr('href');
            return;
        }
    } else if (event.which == 38 || event.which == 40) {
        $('#search-resultbox').show();

        var selected = $('#search-resultbox a.selected');
        if (selected.length == 0) {
            $('#search-results').find('a').first().addClass('selected');
        } else {
            var next;
            if (event.which == 40) {
                next = selected.parent().next().find('a').first();
            } else {
                next = selected.parent().prev().find('a').first();
            }
            if (next.length != 0) {
                var resultbox = $('#search-results');
                var position = next.position();

//              TODO scrolling is buggy and jumps around
//                resultbox.scrollTop(Math.floor(position.top));
//                console.log(position.top);

                selected.removeClass('selected');
                next.addClass('selected');
            }
        }

        return;
    }
    $('#search-resultbox').show();
    $('#search-results').html('<li><span class="no-results">No results</span></li>');

    var result = jssearch.search(query);

    if (result.length > 0) {
        var i = 0;
        var resHtml = '';

        for (var key in result) {
            if (i++ > 20) {
                break;
            }
            resHtml = resHtml +
            '<li><a href="' + result[key].file.u.substr(3) +'"><span class="title">' + result[key].file.t + '</span>' +
            '<span class="description">' + result[key].file.d + '</span></a></li>';
        }
        $('#search-results').html(resHtml);
    }
});

// hide the search results on ESC
$(document).on("keyup", function(event) { if (event.which == 27) { $('#search-resultbox').hide(); } });
// hide search results on click to document
$(document).bind('click', function (e) { $('#search-resultbox').hide(); });
// except the following:
searchBox.bind('click', function(e) { e.stopPropagation(); });
$('#search-resultbox').bind('click', function(e) { e.stopPropagation(); });

});</script></body>
</html>
